Abstracts

Problematic

How can we work with abstracted data and information which are not directly related to our project main logic?

Documentation

The tool to check the availability or syntax of domains, IPv4, IPv6 or URL.

██████╗ ██╗   ██╗███████╗██╗   ██╗███╗   ██╗ ██████╗███████╗██████╗ ██╗     ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║   ██║████╗  ██║██╔════╝██╔════╝██╔══██╗██║     ██╔════╝
██████╔╝ ╚████╔╝ █████╗  ██║   ██║██╔██╗ ██║██║     █████╗  ██████╔╝██║     █████╗
██╔═══╝   ╚██╔╝  ██╔══╝  ██║   ██║██║╚██╗██║██║     ██╔══╝  ██╔══██╗██║     ██╔══╝
██║        ██║   ██║     ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝        ╚═╝   ╚═╝      ╚═════╝ ╚═╝  ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝

Provides the abtracted logics/data.

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.

Infrastructure()

class PyFunceble.abstracts.infrastructure.Infrastructure[source]

Provides some infrastructure related abstractions.

CONFIGURATION_FILENAME = '.PyFunceble.yaml'

Sets the name of the user editable configuration file.

Type:str
DEFAULT_CONFIGURATION_FILENAME = '.PyFunceble_production.yaml'

Sets the name of the default configuration file.

Type:str
DOWN_FILENAME = '.pyfunceble_intern_downtime.json'

Sets the name of our own download time record file.

Type:str
ENV_FILENAME = '.pyfunceble-env'

Sets the name of our own environment file.

Type:str
IANA_FILENAME = 'iana-domains-db.json'

Sets the name of our own IANA database file.

Type:str
IPV4_REPUTATION_FILENAME = 'ipv4_reputation.data'

Sets the name of our own copy of the IPv4 reputation data file.

Type:str

Sets the link to the production configuration file.

Type:str

Sets the link to the repository.

Type:str
USER_AGENT_FILENAME = 'user_agents.json'

Sets the name of our own copy of the user agents file.

Package()

class PyFunceble.abstracts.package.Package[source]

Provides some packaging related abstractions.

NAME = 'PyFunceble'

Sets the package name.

Type:str
VERSION = '3.1.0. (Teal Blauwbok: Ladybug)'

Sets the package version.

Type:str

Platform()

class PyFunceble.abstracts.platform.Platform[source]

Provides an easy way to get the current platform.

MAC = ['darwin']

Provides teh list of supported MAC platform.

Type:list
UNIX = ['linux', 'darwin']

Provides the list of supported unix platform.

Type:list
WINDOWS = ['windows', 'cygwin', 'cygwin_nt-10.0']

Provides the list of supported windows platform.

Type:list
classmethod get()[source]

Returns the current platform.

Return type:str
classmethod is_mac_os()[source]

Checks if the current platform is in our OSX list.

Return type:bool
classmethod is_unix()[source]

Checks if the current platform is in our unix list.

Return type:bool
classmethod is_windows()[source]

Checks if the current platform is in our windows list.

Return type:bool

Version()

class PyFunceble.abstracts.package.Version[source]

Provides a simple way to compare our own versions.

classmethod compare(upstream)[source]

Compares the given versions with the local one.

Parameters:
  • local (list) – The local version converted by split_versions().
  • upstream (list) – The upstream version converted by split_versions().
Returns:

  • True: local < upstream
  • None: local == upstream
  • False: local > upstream

Return type:

bool, None

classmethod is_local_cloned()[source]

Checks if the local version is was downloaded per git clone.

classmethod is_local_dev()[source]

Checks if the local version is the development version.

classmethod literally_compare(local, upstream)[source]

Compares the given versions, literally.

Parameters:
  • local (str) – The local version converted by split_versions().
  • upstream (str) – The upstream version converted by split_versions().
Returns:

  • True: local == upstream
  • False: local != upstream

Return type:

bool

classmethod split_versions(version, return_non_digits=False)[source]

Converts the versions to a shorter one.

Parameters:
  • version (str) – The version to split.
  • return_non_digits (bool) – Activate the return of the non-digits parts of the splitted version.
Returns:

A tuple. The first index is the digit part of the version, when the second one is the the non-digit part of the version.

Return type:

tuple