Converter¶
Problematic¶
How can we convert some data into something else or something our system understand.
Documentation¶
The tool to check the availability or syntax of domains, IPv4, IPv6 or URL.
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ ██████╔╝██║ █████╗
██╔═══╝ ╚██╔╝ ██╔══╝ ██║ ██║██║╚██╗██║██║ ██╔══╝ ██╔══██╗██║ ██╔══╝
██║ ██║ ██║ ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝
Provides the converters.
- 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:
MIT License
Copyright (c) 2017, 2018, 2019, 2020 Nissar Chababy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
ConverterBase()
¶
AdBlock()
¶
-
class
PyFunceble.converter.adblock.
AdBlock
(data_to_convert, aggressive=False)[source]¶ Converts an adblock filter line to a list os subject to test.
-
_AdBlock__decode_v1
(data)¶ Decodes the v1.
Parameters: data (str) – A string to decode. Return type: list
-
_AdBlock__decode_v2
(data)¶ Decodes the v2.
Parameters: data (str) – A string to decode. Return type: list
-
_AdBlock__decode_v3
(data)¶ Decodes the v3.
Parameters: data (str) – A string to decode. Return type: list
-
_AdBlock__decode_v4
(data)¶ Decodes the v4.
Parameters: data (str) – A string to decode. Return type: list
-
extract_base
(subject)[source]¶ Extracts the base of the given element.
- As an example:
- given
"hello.world/?is=beautiful"
returns"hello.world"
Parameters: subject – The subject to work with.
-
extract_from_options
(options)[source]¶ Exctracts the relevant data from the list of options.
Parameters: options (list) – The list of options of a rule. Returns: The list of domains. Return type: list
-
format_decoded
(decoded, result=None)[source]¶ Formats the extracted adblock line in order to be compatible with what the system understand.
Parameters: Returns: The list of domains or IP compatible with the system.
Return type:
-
Digit2Digits()
¶
File()
¶
InternalUrl()
¶
-
class
PyFunceble.converter.internal_url.
InternalUrl
(data_to_convert)[source]¶ Converter of the internal URLs.
Note
The internal URLs are actually the URL that has nothing to do with what we are going to test.
They are only relevant for the software itself.
Parameters: data_to_convert (str) – The data to convert