Announcing quantpylib.throttler
Since we officially released our quant collaborative Github repo last month:
We have been working hard to bring you new and inspiring features you can integrate into your own quant dev projects. Recently, we were working on the data pollers:
To truly be able to build a robust framework as well as throttle external APIs efficiently, we previously discussed the credit_semaphore. We are proud to announce the v2.0 of that semaphore, and will be maintaining it as part of the quantpylib official library.
Announcing…
quantpylib.throttler
This module provides both synchronous and asynchronous support for rate-limiting access to function calls via a credit-based semaphore synchronization tool.
A simple but common use would be to maximise throughput of API requests to an external server that places rate-limits on the number of API requests per minute/hour with request credits charged against a resource pool.
This is made available by the RateSemaphore
and AsyncRateSemaphore
classes - and can be seen as an extension of the synchronization primitives threading.Semaphore
and asyncio.locks.Semaphore
in the Python standard library respectively.
We also added new features such as greedy entry and greedy exit toggles to the asynchronous semaphore.
The official documentation, examples and more can be found here:
https://hangukquant.github.io/throttler/throttler/
Access to this repo is for annual/lifetime members and can accessed here:
Monthly/free subscribers can email me for case-by-case consideration.
We will be using the throttler library to enhance the data poller, and migrate the data poller to the quantpylib module soon.