PyFunceble.cli.filesystem package
Subpackages
- PyFunceble.cli.filesystem.dir_structure package
- PyFunceble.cli.filesystem.printer package
- Submodules
- PyFunceble.cli.filesystem.printer.base module
PrinterBasePrinterBase.HEADERSPrinterBase.STD_LENGTHPrinterBase.STD_UNKNOWNPrinterBase.TEMPLATESPrinterBase.datasetPrinterBase.ensure_dataset_is_given()PrinterBase.ensure_template_to_use_is_given()PrinterBase.get_header_to_print()PrinterBase.get_line_to_print()PrinterBase.print_header()PrinterBase.print_interpolated_line()PrinterBase.set_dataset()PrinterBase.set_skip_column()PrinterBase.set_template_to_use()PrinterBase.skip_columnPrinterBase.template_to_use
- PyFunceble.cli.filesystem.printer.file module
- PyFunceble.cli.filesystem.printer.stdout module
StdoutPrinterStdoutPrinter.BACKGROUND_COLORATEDStdoutPrinter.FOREGROUND_COLORATEDStdoutPrinter.STATUS2BACKGROUND_COLORStdoutPrinter.STATUS2FORGROUND_COLORStdoutPrinter.STD_ALLOW_COLORATIONStdoutPrinter.STD_FILE_HEADERStdoutPrinter.allow_colorationStdoutPrinter.guess_allow_coloration()StdoutPrinter.print_interpolated_line()StdoutPrinter.set_allow_coloration()
- Module contents
Submodules
PyFunceble.cli.filesystem.cleanup module
The tool to check the availability or syntax of domain, IP or URL.
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ ██████╔╝██║ █████╗
██╔═══╝ ╚██╔╝ ██╔══╝ ██║ ██║██║╚██╗██║██║ ██╔══╝ ██╔══██╗██║ ██╔══╝
██║ ██║ ██║ ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝
Provides everything related to the cleanup of the filesystem.
- Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
- Special thanks:
- Contributors:
- Project link:
- Project documentation:
- Project homepage:
License:
Copyright 2017, 2018, 2019, 2020, 2022, 2023, 2024 Nissar Chababy
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
- class PyFunceble.cli.filesystem.cleanup.FilesystemCleanup(parent_dirname: str | None = None, *, db_session: DBSession | None = None)[source]
Bases:
FilesystemDirBaseProvides the interface for the cleanup of the filesystem.
- clean_database() FilesystemCleanup[source]
Cleanups the uneeded data that were stored in the database.
Warning
This method cleans everything except the WHOIS records.
- clean_output_files() FilesystemCleanup[source]
Cleanups the unneeded files from the output directory.
- file_helper: FileHelper = <PyFunceble.helpers.file.FileHelper object>
- start() FilesystemCleanup[source]
Starts the cleanup of everything unneeded.
PyFunceble.cli.filesystem.counter module
The tool to check the availability or syntax of domain, IP or URL.
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ ██████╔╝██║ █████╗
██╔═══╝ ╚██╔╝ ██╔══╝ ██║ ██║██║╚██╗██║██║ ██╔══╝ ██╔══██╗██║ ██╔══╝
██║ ██║ ██║ ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝
Provides everything related to our counter tracker.
- Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
- Special thanks:
- Contributors:
- Project link:
- Project documentation:
- Project homepage:
License:
Copyright 2017, 2018, 2019, 2020, 2022, 2023, 2024 Nissar Chababy
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
- class PyFunceble.cli.filesystem.counter.FilesystemCounter(parent_dirname: str | None = None, *, db_session: DBSession | None = None)[source]
Bases:
FilesystemJSONBaseProvides our counter.
- PERCENTAGE_STATUSES: Dict[str, List[str]] = {'AVAILABILITY': ['ACTIVE', 'INACTIVE', 'INVALID'], 'REPUTATION': ['SANE', 'MALICIOUS'], 'SYNTAX': ['VALID', 'INVALID']}
- STD_DATASET: Dict[str, int] = {'counter': {'ACTIVE': 0, 'INACTIVE': 0, 'INVALID': 0, 'MALICIOUS': 0, 'SANE': 0, 'VALID': 0, 'total': 0}, 'percentage': {'ACTIVE': 0, 'INACTIVE': 0, 'INVALID': 0, 'MALICIOUS': 0, 'SANE': 0, 'VALID': 0, 'total': 0}}
- count(status: CheckerStatusBase) FilesystemCounter[source]
Starts the counting process.
- Parameters:
status – The status to count into our dataset.
PyFunceble.cli.filesystem.dir_base module
The tool to check the availability or syntax of domain, IP or URL.
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ ██████╔╝██║ █████╗
██╔═══╝ ╚██╔╝ ██╔══╝ ██║ ██║██║╚██╗██║██║ ██╔══╝ ██╔══██╗██║ ██╔══╝
██║ ██║ ██║ ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝
Provides a common base to the manipulation of the output directory.
- Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
- Special thanks:
- Contributors:
- Project link:
- Project documentation:
- Project homepage:
License:
Copyright 2017, 2018, 2019, 2020, 2022, 2023, 2024 Nissar Chababy
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
- class PyFunceble.cli.filesystem.dir_base.FilesystemDirBase(parent_dirname: str | None = None, *, db_session: DBSession | None = None)[source]
Bases:
objectProvides a common base for the manipulation of our output directory.
- get_output_basedir() str[source]
Provides the output base directory.
- Parameters:
create_if_missing – Authorizes the creation of the directory if it’s missing.
- set_differ_to_inline(value: bool) FilesystemDirBase[source]
Allows/Disallow the split to the inline directory. The attribute can be set when you want to overwrite the behavior of the
get_output_basedirmethod.- Parm value:
The value to set.
- set_parent_dirname(value: str) FilesystemDirBase[source]
Sets the parent dirname. The parent dirname is a directory which acts a parent into the output directory.
- Parm value:
The value to set.
PyFunceble.cli.filesystem.json_base module
The tool to check the availability or syntax of domain, IP or URL.
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ ██████╔╝██║ █████╗
██╔═══╝ ╚██╔╝ ██╔══╝ ██║ ██║██║╚██╗██║██║ ██╔══╝ ██╔══██╗██║ ██╔══╝
██║ ██║ ██║ ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝
Provides a base for the manipulation of JSON files.
- Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
- Special thanks:
- Contributors:
- Project link:
- Project documentation:
- Project homepage:
License:
Copyright 2017, 2018, 2019, 2020, 2022, 2023, 2024 Nissar Chababy
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
- class PyFunceble.cli.filesystem.json_base.FilesystemJSONBase(parent_dirname: str | None = None, *, db_session: DBSession | None = None)[source]
Bases:
FilesystemDirBaseA base interface for the manipulation of JSON files.
- fetch_dataset() FilesystemJSONBase[source]
Fetch the dataset from the source file.
- fetch_dataset_beforehand()[source]
Updates the dataset to work with before launching the decorated method.
- save_dataset() FilesystemJSONBase[source]
Saves the current dataset into it’s final destination.
PyFunceble.cli.filesystem.registrar_counter module
The tool to check the availability or syntax of domain, IP or URL.
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ ██████╔╝██║ █████╗
██╔═══╝ ╚██╔╝ ██╔══╝ ██║ ██║██║╚██╗██║██║ ██╔══╝ ██╔══██╗██║ ██╔══╝
██║ ██║ ██║ ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝
Provides everything related to the registrar counter.
- Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
- Special thanks:
- Contributors:
- Project link:
- Project documentation:
- Project homepage:
License:
Copyright 2017, 2018, 2019, 2020, 2022, 2023, 2024 Nissar Chababy
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
- class PyFunceble.cli.filesystem.registrar_counter.RegistrarCounter(parent_dirname: str | None = None, *, db_session: DBSession | None = None)[source]
Bases:
FilesystemJSONBaseProvides our registrar stats counter.
- count(registrar: str) RegistrarCounter[source]
Starts the counting process.
- Parameters:
registrar – The registrar to count into our dataset.
- get_dataset_for_printer(*, limit: int | None = 15) List[Dict[str, str | int]][source]
Provides the dataset that the printer may understand.
- Parameters:
limit –
Maximum number of registrars to display.
Warning
If set to
None, all registrars will be displayed.- Raises:
ValueError – When the current testing mode is not supported (yet?).
PyFunceble.cli.filesystem.status_file module
The tool to check the availability or syntax of domain, IP or URL.
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ ██████╔╝██║ █████╗
██╔═══╝ ╚██╔╝ ██╔══╝ ██║ ██║██║╚██╗██║██║ ██╔══╝ ██╔══██╗██║ ██╔══╝
██║ ██║ ██║ ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝
Provides everything related to our status file generation.
- Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
- Special thanks:
- Contributors:
- Project link:
- Project documentation:
- Project homepage:
License:
Copyright 2017, 2018, 2019, 2020, 2022, 2023, 2024 Nissar Chababy
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
- class PyFunceble.cli.filesystem.status_file.StatusFileGenerator(status: SyntaxCheckerStatus | AvailabilityCheckerStatus | ReputationCheckerStatus | None = None, *, allow_hosts_files: bool | None = None, allow_plain_files: bool | None = None, allow_analytic_files: bool | None = None, hosts_ip: str | None = None, allow_unified_file: bool | None = None, parent_dirname: str | None = None, test_dataset: dict | None = None)[source]
Bases:
FilesystemDirBaseProvides an interface for the generation of the status file from a given status.
- property allow_analytic_files: bool
Provides the current state of the
_allow_analytic_filesattribute.
- ensure_status_is_given()[source]
Ensures that the status is given before launching the decorated method.
- Raises:
TypeError – When
self.statusis not set.
- file_printer: FilePrinter = <PyFunceble.cli.filesystem.printer.file.FilePrinter object>
- generate_analytic_file() StatusFileGenerator[source]
Generates the analytic files.
- generate_hosts_file() StatusFileGenerator[source]
Generates the hosts file.
- generate_plain_file() StatusFileGenerator[source]
Generates the plain file.
- generate_splitted_status_file() StatusFileGenerator[source]
Generates the splitted status file.
- generate_unified_status_file() StatusFileGenerator[source]
Generates the unified status file.
- get_output_basedir() str[source]
Provides the output base directory.
- Parameters:
create_if_missing – Authorizes the creation of the directory if it’s missing.
- guess_all_settings() StatusFileGenerator[source]
Try to guess all settings.
- guess_and_set_allow_analytic_files() StatusFileGenerator[source]
Tries to guess the value of the
allow_analytic_filesfrom the configuration file.
- guess_and_set_allow_hosts_files() StatusFileGenerator[source]
Tries to guess the value of the
allow_hosts_filesfrom the configuration file.
- guess_and_set_allow_plain_files() StatusFileGenerator[source]
Tries to guess the value of the
allow_plain_filesfrom the configuration file.
- guess_and_set_allow_unified_file() StatusFileGenerator[source]
Tries to guess the value of the
allow_unified_filefrom the configuration file.
- guess_and_set_hosts_ip() StatusFileGenerator[source]
Tries to guess the value of the
hosts_ipfrom the configuration file.
- set_allow_analytic_files(value: bool) StatusFileGenerator[source]
Sets the authorization to generation of analytic files.
- Parameters:
value – The value to set.
- set_allow_hosts_files(value: bool) StatusFileGenerator[source]
Sets the authorization to generation of hosts files.
- Parameters:
value – The value to set.
- set_allow_plain_files(value: bool) StatusFileGenerator[source]
Sets the authorization to generation of plain files.
- Parameters:
value – The value to set.
- set_allow_unified_file(value: bool) StatusFileGenerator[source]
Sets the authorization to generation of the unified status file.
- Parameters:
value – The value to set.
- set_hosts_ip(value: str) StatusFileGenerator[source]
Sets the hosts IP to use while generating the hosts files.
- Parameters:
value – The value to set.
- set_status(value: CheckerStatusBase) StatusFileGenerator[source]
Sets the status to work with.
- Parameters:
value – The value to set.
- set_test_dataset(value: dict) StatusFileGenerator[source]
Sets the test dataset which was given to the tester.
- Parameters:
value – The value to set.
- Raises:
TypeError – When the given
valueis not a :py:class`dict`.
- start() StatusFileGenerator[source]
Starts the generation of everything possible.
- property status: CheckerStatusBase
Provides the current state of the
_statusattribute.
Module contents
The tool to check the availability or syntax of domain, IP or URL.
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ ██████╔╝██║ █████╗
██╔═══╝ ╚██╔╝ ██╔══╝ ██║ ██║██║╚██╗██║██║ ██╔══╝ ██╔══██╗██║ ██╔══╝
██║ ██║ ██║ ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝
Provides everything related to our very own filesystem or output structure.
- Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
- Special thanks:
- Contributors:
- Project link:
- Project documentation:
- Project homepage:
License:
Copyright 2017, 2018, 2019, 2020, 2022, 2023, 2024 Nissar Chababy
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.