A wrapper around requests to tackle unstable timeout issues
Project description
reqto
A wrapper around requests to tackle unstable timeout issues
Installation
Use the package manager pip to install reqto.
pip install reqto
Usage
import reqto
response = reqto.get(url,timeout=5,timeout_function=custom_function,timeout_args=custom_args)
Example
import reqto
def custom_function(parameter):
print(parameter)
package="reqto"
response = reqto.get(f'https://pypi.org/pypi/{package}/json',timeout=5,timeout_function=custom_function,timeout_args="Timeout custom function called")
"""Will call timeout_function instead of raising an exception on Timeout"""
print(response)
response = reqto.get(f'https://pypi.org/pypi/{package}/json',timeout=1)
"""Will raise exception on Timeout"""
print(response)
Current scope
Done: GET, POST, PUT, DELETE, PATCH requests working fine with timeout
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
reqto-0.1.7.tar.gz
(3.2 kB
view details)
Built Distribution
reqto-0.1.7-py3-none-any.whl
(4.4 kB
view details)
File details
Details for the file reqto-0.1.7.tar.gz
.
File metadata
- Download URL: reqto-0.1.7.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35bfebe5a7682ca087b9d98163138a5275c188d7866f96ca874eab4ca949b8b8 |
|
MD5 | 9c6e027f9ff18c7e34a39eb9bfd77d32 |
|
BLAKE2b-256 | 41a50affa8e9f4b2d2afbbd4a9cf5527f42d33023a9ad14e8ca32794f21553c9 |
File details
Details for the file reqto-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: reqto-0.1.7-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b304e4fd19ab6dee46f18ff8e9f339f7f1d59a3c08a32d846b897b83e0ef9493 |
|
MD5 | f380aeefe89f2d5cf473fb1715fa44a0 |
|
BLAKE2b-256 | eaf4876f64b52b924a9952d9fe6111c05494192258d9664df571fbb0a0f35f23 |