Skip to content

zaquest/requests_throttled

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

requests_throttled

Provides a simple class decorator throttle to be used on requests.Session or subclasses. It adds a required keyword argument rate to class's constructor, which is a maximum number of requests per second that session will be sending. Blocks to wait until it is allowed to send next request.

It works by creating a subclass with overriden send method.

from requests_throttled import Session
with Session(rate=2) as s:
  ...  # use `s` here, won't allow more than 2 requests per second

About

Throttling `requests.Session`.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages