PyFunceble.query package

Submodules

PyFunceble.query.http_status_code module

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

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

Provides our interface for getting the status code of a given subject.

Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
Special thanks:
https://pyfunceble.github.io/#/special-thanks
Contributors:
https://pyfunceble.github.io/#/contributors
Project link:
https://github.com/funilrys/PyFunceble
Project documentation:
https://pyfunceble.readthedocs.io/en/dev/
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.query.http_status_code.HTTPStatusCode(subject: Optional[str] = None, *, timeout: Optional[float] = None, verify_certificate: Optional[bool] = None, allow_redirects: Optional[bool] = None)[source]

Bases: object

Provides an interface for the extration of the HTTP status code.

STD_ALLOW_REDIRECTS = False
STD_TIMEOUT = 5.0
STD_UNKWON_STATUS_CODE = 99999999
STD_VERIFY_CERTIFICATE = True
_allow_redirects = False
_subject = None
_timeout = 5.0
_verify_certificate = True
allow_redirects

Provides the current state of the _allow_redirects attribute.

ensure_subject_is_given()[source]

Ensures that the subject is given before running the decorated method.

Raises:TypeError – If the subject is not a string.
get_status_code() → int[source]

Provides the status code.

guess_and_set_timeout() → PyFunceble.query.http_status_code.HTTPStatusCode[source]

Tries to guess and set the timeout from the configuration.

guess_and_set_verify_certificate() → PyFunceble.query.http_status_code.HTTPStatusCode[source]

Tries to guess and set the verify_certificate attribute.

set_allow_redirects(value: bool) → PyFunceble.query.http_status_code.HTTPStatusCode[source]

Sets the value of the verify_certificate variable.

Parameters:value – The value to set.
set_subject(value: str) → PyFunceble.query.http_status_code.HTTPStatusCode[source]

Sets the subject to work with.

Parameters:value – The subject to set.
set_timeout(value: Union[float, int]) → PyFunceble.query.http_status_code.HTTPStatusCode[source]

Sets the timeout to apply.

Parameters:value – The timeout to apply.
set_verify_certificate(value: bool) → PyFunceble.query.http_status_code.HTTPStatusCode[source]

Sets the value of the verify_certificate variable.

Parameters:value – The value to set.
subject

Provides the current state of the _subject attribute.

timeout

Provides the current state of the _timeout attribute.

verify_certificate

Provides the current state of the verify_certificate attribute.

Module contents

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

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

Provides everything related queries and communication with target resources and information.

Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
Special thanks:
https://pyfunceble.github.io/#/special-thanks
Contributors:
https://pyfunceble.github.io/#/contributors
Project link:
https://github.com/funilrys/PyFunceble
Project documentation:
https://pyfunceble.readthedocs.io/en/dev/
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.