klyrek-http¶
Status: live on PyPI — pip install klyrek-http
The scope-checked HTTP client every other package builds its requests through. Rate-limited per host, and it re-checks AuthorizationScope on every redirect hop, not just the first request.
from klyrek_http.client import KlyrekHTTPClient
from klyrek_core.config import KlyrekConfig
with KlyrekHTTPClient(scope, config=KlyrekConfig(rate_limit_per_host=5.0)) as client:
response = client.get("https://shop.sandbox.klyrek.com/")
Every request — including ones your own code makes through this client, not just the crawler's — is checked against scope on the initial URL and on every redirect target via an httpx event hook.
API reference¶
klyrek_http.client ¶
A scope-checked, rate-limited HTTP client shared across the Klyrek ecosystem.
KlyrekHTTPClient ¶
KlyrekHTTPClient(scope: AuthorizationScope, config: KlyrekConfig | None = None, transport: BaseTransport | None = None)
Every Klyrek package that talks to a target should issue requests through this client.
It enforces the scan's :class:AuthorizationScope and per-host rate limit on every
request, so no individual package has to remember to do so itself.