PyFunceble.cli.scripts package¶
Submodules¶
PyFunceble.cli.scripts.iana module¶
The tool to check the availability or syntax of domain, IP or URL.
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ ██████╔╝██║ █████╗
██╔═══╝ ╚██╔╝ ██╔══╝ ██║ ██║██║╚██╗██║██║ ██╔══╝ ██╔══██╗██║ ██╔══╝
██║ ██║ ██║ ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝
Provides our iana file generator.
- Author:
- Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
- Special thanks:
- https://pyfunceble.github.io/#/special-thanks
- Contributors:
- https://pyfunceble.github.io/#/contributors
- Project link:
- https://github.com/funilrys/PyFunceble
- Project documentation:
- https://pyfunceble.readthedocs.io/en/latest/
- Project homepage:
- https://pyfunceble.github.io/
License:
Copyright 2017, 2018, 2019, 2020, 2021 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.
-
class
PyFunceble.cli.scripts.iana.
IanaDBGenerator
(destination: Optional[str] = None)[source]¶ Bases:
object
Provides an interface for the generation of the iana database file.
-
IANA_WHOIS_SERVER
= 'whois.iana.org'¶ The WHOIS server provided by the IANA.
-
MANUAL_SERVER
= {'bm': 'whois.afilias-srs.net', 'bz': 'whois.afilias-grs.net', 'cd': 'chois.nic.cd', 'cm': 'whois.netcom.cm', 'fj': 'whois.usp.ac.fj', 'ga': 'whois.my.ga', 'int': 'whois.iana.org', 'ipiranga': ' whois.nic.ipiranga', 'lc': 'whois2.afilias-grs.net', 'now': ' whois.nic.now', 'pharmacy': ' whois.nic.pharmacy', 'piaget': ' whois.nic.piaget', 'ps': 'whois.pnina.ps', 'rw': 'whois.ricta.org.rw', 'shaw': 'whois.afilias-srs.net', 'xn--1ck2e1b': 'whois.nic.xn--1ck2e1b', 'xn--2scrj9c': 'whois.inregistry.net', 'xn--3hcrj9c': 'whois.inregistry.net', 'xn--45br5cyl': 'whois.inregistry.net', 'xn--45brj9c': 'whois.inregistry.net', 'xn--8y0a063a': 'whois.nic.xn--8y0a063a', 'xn--bck1b9a5dre4c': 'whois.nic.xn--bck1b9a5dre4c', 'xn--cck2b3b': 'whois.nic.xn--cck2b3b', 'xn--czr694b': 'whois.nic.xn--czr694b', 'xn--e1a4c': 'whois.eu', 'xn--eckvdtc9d': 'whois.nic.xn--eckvdtc9d', 'xn--fct429k': 'whois.nic.xn--fct429k', 'xn--fpcrj9c3d': 'whois.inregistry.net', 'xn--fzc2c9e2c': 'whois.nic.lk', 'xn--g2xx48c': 'whois.nic.xn--g2xx48c', 'xn--gckr3f0f': 'whois.nic.xn--gckr3f0f', 'xn--gecrj9c': 'whois.inregistry.net', 'xn--gk3at1e': 'whois.nic.xn--gk3at1e', 'xn--h2breg3eve': 'whois.inregistry.net', 'xn--h2brj9c': 'whois.inregistry.net', 'xn--h2brj9c8c': 'whois.inregistry.net', 'xn--imr513n': 'whois.nic.xn--imr513n', 'xn--jvr189m': 'whois.nic.xn--jvr189m', 'xn--kpu716f': 'whois.nic.xn--kpu716f', 'xn--mgba3a3ejt': 'whois.nic.xn--mgba3a3ejt', 'xn--mgbb9fbpob': 'whois.nic.xn--mgbb9fbpob', 'xn--mgbbh1a': 'whois.inregistry.net', 'xn--mgbbh1a71e': 'whois.inregistry.net', 'xn--mgbgu82a': 'whois.inregistry.net', 'xn--nyqy26a': 'whois.nic.xn--nyqy26a', 'xn--otu796d': 'whois.nic.xn--otu796d', 'xn--pbt977c': 'whois.nic.xn--pbt977c', 'xn--rhqv96g': 'whois.nic.xn--rhqv96g', 'xn--rovu88b': 'whois.nic.xn--rovu88b', 'xn--rvc1e0am3e': 'whois.inregistry.net', 'xn--s9brj9c': 'whois.inregistry.net', 'xn--ses554g': 'whois.registry.knet.cn', 'xn--wgbh1c': 'whois.dotmasr.eg', 'xn--xkc2al3hye2a': 'whois.nic.lk', 'xn--xkc2dl3a5ee0h': 'whois.inregistry.net', 'za': 'whois.registry.net.za'}¶
-
UPSTREAM_LINK
= 'https://www.iana.org/domains/root/db'¶ Provides the upstream link.
-
database
= {}¶ An internal storage map.
-
destination
¶ Provides the current state of the
_destination
attribute.
-
get_extension_and_referrer_from_block
(block: str) → Tuple[Optional[str], Optional[str]][source]¶ Given an HTML block, we try to extract an extension and it’s underlying referrer (WHOIS server).
The referrer is extracted from the official IANA page, and guessed if missing.
Parameters: block – The block to parse.
-
get_referrer_from_extension
(extension: str) → Optional[str][source]¶ Given an extension, tries to get or guess its extension.
-
PyFunceble.cli.scripts.production module¶
The tool to check the availability or syntax of domain, IP or URL.
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ ██████╔╝██║ █████╗
██╔═══╝ ╚██╔╝ ██╔══╝ ██║ ██║██║╚██╗██║██║ ██╔══╝ ██╔══██╗██║ ██╔══╝
██║ ██║ ██║ ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝
Provides some of our scripts.
- Author:
- Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
- Special thanks:
- https://pyfunceble.github.io/#/special-thanks
- Contributors:
- https://pyfunceble.github.io/#/contributors
- Project link:
- https://github.com/funilrys/PyFunceble
- Project documentation:
- https://pyfunceble.readthedocs.io/en/latest/
- Project homepage:
- https://pyfunceble.github.io/
License:
Copyright 2017, 2018, 2019, 2020, 2021 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.
-
class
PyFunceble.cli.scripts.production.
ProductionPrep
(branch: Optional[str] = None)[source]¶ Bases:
object
Provides an interface for the production file modification. The idea is that we always have 2 branches: the dev and the master branch.
We want to fix all the URL to point to the right one, so this interface just provides everything needed for that job.
Another important part is the cleanup of the production environment. What is meant is the cleanup of the output/ directory and the construction of the dir_structure file.
Warning
This class assumes that you know what you are doing. Meaning that you should run this only if your are developing PyFunceble.
-
AVAILABLE_BRANCHES
= ['dev', 'master']¶
-
VERSION_FILE_PATH
= '/home/docs/./PyFunceble/version.yaml'¶
-
branch
¶ Provides the current state of the
_branch
attribute.
-
dict_helper
= <PyFunceble.helpers.dict.DictHelper object>¶
-
ensure_branch_is_given
()[source]¶ Ensures that the branch is given before running the decorated method.
Raises: TypeError – When the self.branch
is not set.
-
file_helper
= <PyFunceble.helpers.file.FileHelper object>¶
-
previous_version
= None¶ Provides the previous version (from
version_file_content
)
-
regex_helper
= <PyFunceble.helpers.regex.RegexHelper object>¶
-
set_branch
(value: str) → PyFunceble.cli.scripts.production.ProductionPrep[source]¶ Sets the branch to act with.
Parameters: value – The value to set.
-
should_be_deprecated
(previous_version: str) → bool[source]¶ Checks if we should deprecates the current version.
-
static
update_code_format
() → PyFunceble.cli.scripts.production.ProductionPrep[source]¶ Updates the format of the source code using black.
-
update_code_urls
() → PyFunceble.cli.scripts.production.ProductionPrep[source]¶ Updates all URL in the source code.
-
update_dir_structure_file
() → PyFunceble.cli.scripts.production.ProductionPrep[source]¶ Updates the directory structure.
-
update_docs_urls
() → PyFunceble.cli.scripts.production.ProductionPrep[source]¶ Updates all URL in the documentation files.
-
static
update_documentation
() → PyFunceble.cli.scripts.production.ProductionPrep[source]¶ Updates the code documentation.
Raises: RuntimeError – When one of the wanted directory is not found.
-
update_setup_py
() → PyFunceble.cli.scripts.production.ProductionPrep[source]¶ Updates content of
setup.py
.Raises: FileNotFoundError – When the setup.py
file does not exists.
-
update_urls
(file: str) → PyFunceble.cli.scripts.production.ProductionPrep[source]¶ Updates the common URLS which are in the given file.
Parameters: file – The file to work with. Raises: FileNotFoundError – When the given file
is not found.
-
update_version_file
() → PyFunceble.cli.scripts.production.ProductionPrep[source]¶ Updates the version file.
-
version_file_content
= None¶ A copy of the local version file.
-
version_utility
= <PyFunceble.utils.version.VersionUtility object>¶
-
PyFunceble.cli.scripts.public_suffix module¶
The tool to check the availability or syntax of domain, IP or URL.
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ ██████╔╝██║ █████╗
██╔═══╝ ╚██╔╝ ██╔══╝ ██║ ██║██║╚██╗██║██║ ██╔══╝ ██╔══██╗██║ ██╔══╝
██║ ██║ ██║ ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝
Provides our public suffix file generator.
- Author:
- Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
- Special thanks:
- https://pyfunceble.github.io/#/special-thanks
- Contributors:
- https://pyfunceble.github.io/#/contributors
- Project link:
- https://github.com/funilrys/PyFunceble
- Project documentation:
- https://pyfunceble.readthedocs.io/en/latest/
- Project homepage:
- https://pyfunceble.github.io/
License:
Copyright 2017, 2018, 2019, 2020, 2021 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.
-
class
PyFunceble.cli.scripts.public_suffix.
PublicSuffixGenerator
(destination: Optional[str] = None)[source]¶ Bases:
object
Provides an interface for the generation of the public suffix file.
-
COMMENT_SIGN
= ['//', '!']¶ The sign which we should consider as comment.
-
UPSTREAM_LINK
= 'https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat'¶ Provides the upstream stream.
-
database
= {}¶ An internal storage of our map.
-
destination
¶ Provides the current state of the
_destination
attribute.
-
set_destination
(value: str) → PyFunceble.cli.scripts.public_suffix.PublicSuffixGenerator[source]¶ Sets the destination to write.
Parameters: value – The value to set.
-
wildacrd2subject
= <PyFunceble.converter.wildcard2subject.Wildcard2Subject object>¶
-
Module contents¶
The tool to check the availability or syntax of domain, IP or URL.
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ ██████╔╝██║ █████╗
██╔═══╝ ╚██╔╝ ██╔══╝ ██║ ██║██║╚██╗██║██║ ██╔══╝ ██╔══██╗██║ ██╔══╝
██║ ██║ ██║ ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝
Provides some of our scripts.
- Author:
- Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
- Special thanks:
- https://pyfunceble.github.io/#/special-thanks
- Contributors:
- https://pyfunceble.github.io/#/contributors
- Project link:
- https://github.com/funilrys/PyFunceble
- Project documentation:
- https://pyfunceble.readthedocs.io/en/latest/
- Project homepage:
- https://pyfunceble.github.io/
License:
Copyright 2017, 2018, 2019, 2020, 2021 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.