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

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.

Infrastructure()

class PyFunceble.abstracts.infrastructure.Infrastructure[source]

Provides some infrastructure related abstractions.

ALEMBIC_DIRECTORY_NAME = 'alembic'

Sets the name of the alembic related directory.

Type:str
CI_MIGRATION_TRIGGER_FILE = '.trigger'

Sets the name of the file to write into for the case that we are migrating to sqlalchemy from inside a CI engine.

Type:str
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
HASHES_FILENAME = 'hashes_tracker.json'

Sets the name of the file which will save the hashes of the files we are testing.

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.3.3. (Teal Blauwbok: Gander)'

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 the 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