Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/poogles/limitediterables
Rate limited Python iterables!
https://github.com/poogles/limitediterables
iterables rate-limit rate-limiter rate-limiting
Last synced: 4 days ago
JSON representation
Rate limited Python iterables!
- Host: GitHub
- URL: https://github.com/poogles/limitediterables
- Owner: Poogles
- License: mit
- Created: 2017-10-17T16:59:50.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-01T13:15:47.000Z (almost 7 years ago)
- Last Synced: 2024-12-06T21:56:17.706Z (27 days ago)
- Topics: iterables, rate-limit, rate-limiter, rate-limiting
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Limited Iterables [![Build Status](https://travis-ci.org/Poogles/limitediterables.svg?branch=master)](https://travis-ci.org/Poogles/limitediterables)
Basic library to rate limit how quickly you get the next value out of an iterable.
## Install
```sh
pip install limitediterables
```## Example
```python
target = range(100)
slow_iter = LimitedIterable(target, limit=50) # This gives us 50 messages a second.for i in slow_iter:
print(i)```
Should be useful for rate limiting against APIs or anything else that's sensitive to number of requests.
## Dev
```
pip install pytest
pytest
```PRs accepted.