Skip to content

feba66/BurstyLimiter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BurstyLimiter

This is a library to help with Burst Ratelimits. I needed to ratelimit my requests for an API game called SpaceTradersAPI, so i wrote this. Originally there was a limit of 2 requests per second + 10 requests per ten seconds.

Small disclaimer: I am now a part of the Team behind SpaceTradersAPI.

Usage

For the usage look at the code below. rate_limited_function has a ratelimit of 2/second plus 10 per 10 seconds, just like what i needed for the game.

pip install burstylimiter
from burstylimiter import Limiter, BurstyLimiter

@BurstyLimiter(Limiter(2, 1), Limiter(10, 10))
def rate_limited_function():
    print("I am Ratelimited")

Tests

Each tests needed its own file because pytest messes with the timing if they are not.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages