THEGOLDENPRO / anmoku

Python's future Jikan API wrapper! With proper rate limiting! [WIP]
MIT License
2 stars 0 forks source link

Rate limiting #3

Open THEGOLDENPRO opened 6 months ago

THEGOLDENPRO commented 6 months ago

The API wrapper will need to handle Jikan's rate limiting respectfully with waiting.

As of the creation of this issue the Jikan rate limits are:

Duration Requests
Daily Unlimited
Per Minute 60 Requests
Per Second 3 Requests

The concept

client = Anmoku()

# this will run fine
character = client.get(AnimeCharacter, id = "101")
character = client.get(AnimeCharacter, id = "2")
character = client.get(AnimeCharacter, id = "362")

# but when ran a fourth time under a second it should hit a rate limit.
character = client.get(AnimeCharacter, id = "67") # the program should wait right here until the time for the rate limit has passed.

character = client.get(AnimeCharacter, id = "0") # this will run after the rate limit wait
THEGOLDENPRO commented 1 month ago

added with #4 using slowstack