edging
Rate limiting that approaches but never exceeds a threshold. Implements a
classic token-bucket limiter with an optional hold_at_threshold() mode
for steady approach without burst overshoot.
Install
pip install edging
Usage
from edging import TokenBucket, RateLimitExceeded
bucket = TokenBucket(rate=5.0, capacity=5.0).hold_at_threshold(True)
assert bucket.acquire(1.0) is True
assert bucket.tokens() < 5.0
try:
# exhaust then fail closed without blocking
for _ in range(10):
bucket.acquire(1.0, blocking=False)
except RateLimitExceeded as e:
assert e.retry_after > 0
Roadmap
This is an early 0.1.0 release with active development planned:
- Async acquire APIs
- Shared / distributed backends
- Adaptive threshold policies
Author
Coldbricks — coldbricks@gmail.com
Metadata
Release files for edging 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| edging-0.1.0.tar.gz | 3.3 kB | Without provenance | Details for edging-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| edging-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for edging-0.1.0-py3-none-any.whl |
Total release size: 7.2 kB
Release files / edging-0.1.0.tar.gz
| Download URL | edging-0.1.0.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2b4660da3fa7a4a33b2da9d28fc1aa49e611a13a0e84290483ee9906d5a94926
|
|
BLAKE2b-256 checksum How to use checksums |
d1692dd6c0fc1145e26f627fe1c61537f7ee566ffad106934d86660c784901b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / edging-0.1.0-py3-none-any.whl
| Download URL | edging-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1b2461d42163c36acd4438d9b4e881e1557e688a7e027279f7c58b59242bd998
|
|
BLAKE2b-256 checksum How to use checksums |
c71a3bc6f27a9444e272c0918c4ad6bd85aba8a1d5dd727c7337f835eee5e4f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for edging 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.