Skip to main content

httpx API client toolkit — pagination, retry, rate limiting, auth refresh, middleware.

Project description

crashbytes-apiclient

httpx API client toolkit — pagination, retry, rate limiting, auth refresh, middleware.

Install

pip install crashbytes-apiclient

Usage

from crashbytes_apiclient import (
    ApiClient, BearerAuth, RetryMiddleware, CursorPaginator,
)

client = ApiClient(
    base_url="https://api.example.com",
    auth=BearerAuth("your-token"),
    middlewares=[RetryMiddleware(max_retries=3)],
)

# Simple requests
response = client.get("/users")
response = client.post("/users", json={"name": "Alice"})

# Paginated iteration
for batch in client.paginate("/items", CursorPaginator()):
    for item in batch:
        process(item)

client.close()

Features

  • Auth: BearerAuth, RefreshableAuth (auto-refresh on 401)
  • Middleware: RetryMiddleware, RateLimitMiddleware, custom middleware protocol
  • Pagination: CursorPaginator, PageNumberPaginator
  • HTTP Methods: .get(), .post(), .put(), .patch(), .delete()
  • Context Manager: with ApiClient(...) as client:

License

MIT

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

crashbytes_apiclient-1.1.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crashbytes_apiclient-1.1.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file crashbytes_apiclient-1.1.1.tar.gz.

File metadata

  • Download URL: crashbytes_apiclient-1.1.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for crashbytes_apiclient-1.1.1.tar.gz
Algorithm Hash digest
SHA256 6e32cf57b61a0435ebbb9739e08ebe9034f3784979f14493b2b725fb0173b94c
MD5 46825d45c3a3307948f412730f2f3d1a
BLAKE2b-256 d19d2a5def07c84a6615290fc7f3dc3138431e3a85e92e8a8be3d44aec039338

See more details on using hashes here.

Provenance

The following attestation bundles were made for crashbytes_apiclient-1.1.1.tar.gz:

Publisher: publish.yml on CrashBytes/crashbytes-apiclient

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file crashbytes_apiclient-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for crashbytes_apiclient-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3004d79c8c97555ecb5ee95fcc34b6744358495cbc487d145ab1dfb3dc59e975
MD5 fdf7d3efedf11471c064a8b10b9a1ae1
BLAKE2b-256 4257e8002b21acc4d6299670ec17d1af4b7df0e7694de72baaf3d5e5bd81183c

See more details on using hashes here.

Provenance

The following attestation bundles were made for crashbytes_apiclient-1.1.1-py3-none-any.whl:

Publisher: publish.yml on CrashBytes/crashbytes-apiclient

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page