Check

Problematic

How can we efficiently check the syntax of IP, domains, and URL?

Documentation

The tool to check the availability or syntax of domain, IP or URL.

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

Provides the syntax checker interface.

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.
class PyFunceble.check.Check(subject)[source]

Provides our syntax checkers.

Parameters:subject (str) – The subject (URL, IP or domain) to check.
SPECIAL_USE_DOMAIN_NAMES_EXTENSIONS = ['onion']

Specifies the extension which are specified as “Special-Use Domain Names” and supported by our project.

Type:list
is_domain(subdomain_check=False)[source]

Checks if the given subject is a valid domain.

Parameters:subdomain_check (bool) –

Activates the subdomain checking.

Warning

Do not manually use.

Please report to is_subdomain().

Returns:The validity.
Return type:bool
is_ip()[source]

Checks if the given subject is a valid IPv4 or IPv6.

Returns:The validity.
Return type:bool
is_ip_range()[source]

Checks if the given subject is a valid IPv4 or IPv6 range.

Returns:The validity.
Return type:bool
is_ipv4()[source]

Checks if the given subject is a valid IPv4.

Returns:The validity.
Return type:bool
is_ipv4_range()[source]

Checks if the given subject is a valid IPv4 range.

Returns:The validity.
Return type:bool
is_ipv6()[source]

Checks if the given subject is a valid IPv6.

Returns:The validity.
Return type:bool
is_ipv6_range()[source]

Checks if the given subject is a valid IPv6 range.

Returns:The validity.
Return type:bool
is_reserved_ip()[source]

Checks if the given subject is a reserved IPv4 or IPv6.

Returns:The validity.
Return type:bool
is_reserved_ipv4()[source]

Checks if the given subject is a reserved IPv4.

Returns:The validity.
Return type:bool
is_reserved_ipv6()[source]

Checks if the given subject is a reserved IPv6.

Returns:The validity.
Return type:bool
is_subdomain()[source]

Checks if the given subject is a valid subdomain.

Returns:The validity.
Return type:bool
is_url(return_base=False, return_formatted=False)[source]

Checks if the given subject is a valid URL.

Parameters:
  • return_base (bool) – Allow us the return of the url base (if URL formatted correctly).
  • return_formatted (bool) – Allow us to get the formatted URL as response.
Returns:

The validity or the base if asked.

Return type:

bool, str