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 domain, IP 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:
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.
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