Core¶
Problematic¶
How can we get started?
Documentation¶
The tool to check the availability or syntax of domain, IP or URL.
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ ██████╔╝██║ █████╗
██╔═══╝ ╚██╔╝ ██╔══╝ ██║ ██║██║╚██╗██║██║ ██╔══╝ ██╔══██╗██║ ██╔══╝
██║ ██║ ██║ ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝
Provides the core interfaces.
- Author:
- Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
- Special thanks:
- https://pyfunceble.github.io/special-thanks.html
- Contributors:
- https://pyfunceble.github.io/contributors.html
- Project link:
- https://github.com/funilrys/PyFunceble
- Project documentation:
- https://pyfunceble.readthedocs.io/en/master/
- Project homepage:
- https://pyfunceble.github.io/
License:
Copyright 2017, 2018, 2019, 2020 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
http://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.
APICore()
¶
-
class
PyFunceble.core.api.
APICore
(subject, complete=False, configuration=None, db_file_name='api_call', is_parent=True)[source]¶ Provides the logic and interface for the tests from the API.
Parameters: -
_APICore__inactive_database_management
(subject, status)¶ Given the subject and status, we add or remove the subject from the inactive database.
-
availability
(subject_type)[source]¶ Make an availability check.
Parameters: subject_type (str) – Should be one of the following.
domain
url
-
reputation
(subject_type)[source]¶ Make a reputation check.
Parameters: subject_type (str) – Should be one of the following.
domain
url
-
CLICore()
¶
-
class
PyFunceble.core.cli.
CLICore
[source]¶ Provides some methods which are dedicated for the CLI.
-
classmethod
_CLICore__check_deprecated
(upstream_version)¶ Checks if the local version is deprecated.
-
classmethod
_CLICore__check_force_update
(upstream_version)¶ Checks if we need to force the update.
If it’s the case, we will stop the tool.
-
classmethod
_CLICore__print_messages
(upstream_version)¶ Looks at the messages and prints the one that needs to be printed.
-
classmethod
colorify_logo
(home=False)[source]¶ Print the colored logo based on global results.
Parameters: home (bool) – Tell us if we have to print the initial coloration.
-
classmethod
compare_version_and_print_messages
()[source]¶ Compares the local with the upstream version.
-
classmethod
get_simple_coloration
(status)[source]¶ Given a status we give the coloration for the simple mode.
Parameters: status (str) – An official status output.
-
classmethod
logs_sharing
()[source]¶ Prints an information message when the logs sharing is activated.
-
classmethod
FileCore()
¶
-
class
PyFunceble.core.file.
FileCore
(file, file_content_type='domain')[source]¶ Brain of PyFunceble for file testing.
Parameters: -
_FileCore__run_single_test
(subject, ignore_inactive_db_check=False)¶ Run a test for a single subject.
-
_FileCore__test_line
(line, ignore_inactive_db_check=False)¶ Tests a given line.
-
cleanup
(auto_continue_db, auto_save, test_completed=False)[source]¶ Runs the logic to run at the end of all test.
-
construct_and_get_shadow_file
(file_stream, ignore_inactive_db_check=False)[source]¶ Provides a path to a file which contain the list to file.
The idea is to do a comparison between what we already tested and what we still have to test.
-
classmethod
download_link
(input_file)[source]¶ Downloads the file if it is an URL and return the name of the new file to test.
-
generate_files_of_status
(status, include_entries_without_changes=False)[source]¶ Generates the status file of all subjects of the given status.
Parameters:
-
post_test_treatment
(test_output, file_content_type, complements_test_started=False, auto_continue_db=None, inactive_db=None, mining=None, whois_db=None)[source]¶ Do the post test treatment.
-
OurProcessWrapper()
¶
-
class
PyFunceble.core.multiprocess.
OurProcessWrapper
(*args, **kwargs)[source]¶ Wrapper of Process. The object of this class is just to overwrite
Process.run()
in order to catch exceptions.Note
This class takes the same arguments as
Process
.-
exception
¶ Provides a way to check if an exception was send.
-
MultiprocessCore()
¶
-
class
PyFunceble.core.multiprocess.
MultiprocessCore
(file, file_content_type='domain')[source]¶ Brain of PyFunceble for file testing with multiple processes.s.
Parameters: -
_MultiprocessCore__check_exception
(processes, manager_data)¶ Checks if an exception is present into the given pool of processes.
:param list processes. A list of running processes.
-
_MultiprocessCore__merge_processes_data
(manager_data, tracker=None)¶ Reads all results and put them at the right location.
-
_MultiprocessCore__process_end_merging
(finished, manager_data, tracker)¶ Processes the end merging.
-
_MultiprocessCore__process_live_merging
(finished, manager_data, tracker)¶ Processes the live merging.
-
_MultiprocessCore__run_multiprocess_test
(stream, manager, ignore_inactive_db_check=False, tracker=None)¶ Tests the content of the given file.
-
_MultiprocessCore__start_process
(subject, manager_data, ignore_inactive_db_check=False)¶ Starts a new process.
-
construct_and_get_shadow_file
(file_stream, ignore_inactive_db_check=False)[source]¶ Provides a path to a file which contain the list to file.
The idea is to do a comparison between what we already tested and what we still have to test.
-