PyFunceble.query.requests package

Submodules

PyFunceble.query.requests.requester module

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

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

Provides our own requests handler

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/latest/
Project homepage:
https://pyfunceble.github.io/

License:

Copyright 2017, 2018, 2019, 2020, 2022, 2023 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.requests.requester.Requester(*, max_retries: Optional[int] = None, verify_certificate: Optional[bool] = None, timeout: Optional[float] = None, max_redirects: Optional[int] = None, dns_query_tool: Optional[PyFunceble.query.dns.query_tool.DNSQueryTool] = None, proxy_pattern: Optional[dict] = None)[source]

Bases: object

Provides our very own requests handler.

Parameters:
  • max_retries (int) – Optional, The maximum number of retries to perform.
  • verify_certificate (bool) – Optional, Should we verify and validate the SSL/TLS certificate ?
  • timeout (float) – Optional, The timeout to apply to the query.
  • max_redirects (int) – Optional, The maximum number of redirects to allow.
  • dns_query_tool – Optional, The DNS Query tool to use.
  • proxy_pattern

    Optional, The proxy pattern to apply to each query.

    Expected format:

    ::
    {
    “global”: {
    # Everything under global will be used as default if no # rule matched.

    ”http”: “str” ## HTTP_PROXY “https”: “str” ## HTTPS_PROXY

    }, “rules”:[

    # A set/list of rules to work with.
    {
    “http”: “str” ## HTTP_PROXY when TLD is matched. “https”: “str” ## HTTPS_PROXY when TLD is matched. “tld”: [
    ”str”, “str”, str

    ]

    }, {

    ”http”: “str” ## HTTP_PROXY when TLD is matched. “https”: “str” ## HTTPS_PROXY when TLD is matched. “tld”: [
    ”str”, “str”

    ]

    },

    ]

    }

STD_MAX_RETRIES = 3
STD_TIMEOUT = 3.0
STD_VERIFY_CERTIFICATE = False
delete(*args, **kwargs) → requests.models.Response[source]

Sends a DELETE request and get its response.

dns_query_tool = None
exceptions = <module 'requests.exceptions' from '/home/docs/checkouts/readthedocs.org/user_builds/pyfunceble/envs/stable/lib/python3.7/site-packages/requests/exceptions.py'>
get(*args, **kwargs) → requests.models.Response[source]

Sends a GET request and get its response.

get_session() → requests.sessions.Session[source]

Provides a new session.

get_timeout() → float[source]

Provides the currently set timetout.

get_verify_certificate() → bool[source]

Provides the current value of the certificate validation.

guess_all_settings() → PyFunceble.query.requests.requester.Requester[source]

Try to guess all settings.

guess_and_set_max_retries() → PyFunceble.query.requests.requester.Requester[source]

Try to guess the value from the configuration and set it.

guess_and_set_proxy_pattern() → PyFunceble.query.requests.requester.Requester[source]

Try to guess the value from the configuration and set it.

guess_and_set_timeout() → PyFunceble.query.requests.requester.Requester[source]

Try to guess the value from the configuration and set it.

guess_and_set_verify_certificate() → PyFunceble.query.requests.requester.Requester[source]

Try to guess the value from the configuration and set it.

head(*args, **kwargs) → requests.models.Response[source]

Sends a HEAD request and get its response.

max_redirects

Provides the current state of the _max_redirects attribute.

max_retries

Provides the current state of the _max_retries attribute.

options(*args, **kwargs) → requests.models.Response[source]

Sends am OPTIONS request and get its response.

patch(*args, **kwargs) → requests.models.Response[source]

Sends a PATCH request and get its response.

post(*args, **kwargs) → requests.models.Response[source]

Sends a POST request and get its response.

proxy_pattern

Provides the current state of the _proxy_pattern attribute.

put(*args, **kwargs) → requests.models.Response[source]

Sends a PUT request and get its response.

recreate_session()[source]

Recreate a new session after executing the decorated method.

request_factory()[source]

Provides a universal request factory.

Parameters:verb – The HTTP Verb to apply.
session = None
set_max_redirects(value: int) → PyFunceble.query.requests.requester.Requester[source]

Sets the max redirects value to apply to all subsequent requests.

Parameters:value – The value to set.
set_max_retries(value: int) → PyFunceble.query.requests.requester.Requester[source]

Sets the max retries value to apply to all subsequent requests.

Parameters:value – The value to set.
set_proxy_pattern(value: dict) → PyFunceble.query.requests.requester.Requester[source]

Overwrite the proxy pattern.

Parameters:value – The value to set.
set_timeout(value: Union[int, float]) → PyFunceble.query.requests.requester.Requester[source]

Enable or disables the certificate validation.

Parameters:value – The value to set.
set_verify_certificate(value: bool) → PyFunceble.query.requests.requester.Requester[source]

Enable or disables the certificate validation.

Parameters:value – The value to set.
timeout

Provides the current state of the _timeout attribute.

urllib3_exceptions = <module 'urllib3.exceptions' from '/home/docs/checkouts/readthedocs.org/user_builds/pyfunceble/envs/stable/lib/python3.7/site-packages/urllib3/exceptions.py'>
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 to our very own request handler.

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/latest/
Project homepage:
https://pyfunceble.github.io/

License:

Copyright 2017, 2018, 2019, 2020, 2022, 2023 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.