Requests for all
Project description
poet-api
Requests with Limiter
class Communicate
init
session: requests.Session(Required)caller_name: str (limiter id)(Required)limiter: Optional[Limiter] = None(Default limiter usesFileLockSQLiteBucket56 requests/minute)stream: bool = Falsetimeout: Union[float, tuple] = 5allow_redirects: bool = True
send
method: str(Required)url: str(Required)headers: Optional[dict] = None(default headers are sent if None)**kwargs(accepted byrequests.Request)
Examples
-
Simplest:
from api import Communicate from requests import Session session = Session() response = Communicate(session=session, caller_name="simple_john").send( method="GET", url="https://john-site.com" ) -
With limiter:
from api import Communicate from pyrate_limiter import Duration, FileLockSQLiteBucket, Limiter, RequestRate from requests import Session session = Session() limiter = Limiter(RequestRate(0.5, Duration.SECOND), bucket_class=FileLockSQLiteBucket) headers = {"User-Agent": ("My Dear Agent v.1")} response = Communicate(session=session, caller_name="John", limiter=limiter).send( method="GET", url="https://mysite.com", headers=headers )
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
poet_api-1.2.18.tar.gz
(4.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file poet_api-1.2.18.tar.gz.
File metadata
- Download URL: poet_api-1.2.18.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.7 Linux/6.1.0-40-amd64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa87537feac4c5bb3e19046a5ece567a0da1ab8c376fb22f5c15905ad8c214c2
|
|
| MD5 |
3464103fc0974dcc12ad2c80628c45d5
|
|
| BLAKE2b-256 |
93716487b7e74ce27f152c87a0ffdd70a999525057c2efa4c6a98b2d4b62b516
|
File details
Details for the file poet_api-1.2.18-py3-none-any.whl.
File metadata
- Download URL: poet_api-1.2.18-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.7 Linux/6.1.0-40-amd64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61a7bd559a662f0b5f3155b2e178c09bd63f5b1f1039ca74eab8569c13edab96
|
|
| MD5 |
b9a861526975ed24d52b184317cc50b6
|
|
| BLAKE2b-256 |
a027c9743cf94bc0d92341a105135808a97abb5084496c66f49495aa63245f34
|