Concurrent request HTTP execution library
Project description
Concurrent request HTTP execution library
What is it?
hyper-requests is a Python library that enables multithreading of API calls using asyncio. It takes a list of URLs and a list of parameters as input and then uses the requests library to make these calls asynchronously (https://pypi.org/project/requests/).
Performance
It is hyper fast!
Within the test/performance
directory there is a performance test that makes 20 API calls to the random joke generator api: https://official-joke-api.appspot.com/random_joke.
Using hyper requests the time taken to make these calls is ~2 second, using syncronous api calls takes ~16 seconds.
============================= test session starts ==============================
collecting ... collected 1 item
test_performance.py::PerformanceTest::test_api_performance
============================== 1 passed in 17.76s ==============================
Process finished with exit code 0
PASSED [100%]
Asynchronous Execution time: 1.845513105392456 seconds
Asynchronous Data length: 20
Synchronous Execution time: 15.81911015510559 seconds
Synchronous Data length: 20
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
Built Distribution
Hashes for hyper_requests-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b651ca6b477f2d946deff39c49dfd39430bd6e204fe563f099a04a22023b2a33 |
|
MD5 | 6ed07549f75fa72a0c22263fa26648c4 |
|
BLAKE2b-256 | 1f906474ed95ddf72769c64ebc95f83b843cc3705277ee10374b8a5eae9d4e58 |