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.4.tar.gz (43.9 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.4-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: crashbytes_apiclient-1.1.4.tar.gz
  • Upload date:
  • Size: 43.9 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.4.tar.gz
Algorithm Hash digest
SHA256 c30066d48ee8ec9854d6455d14c7525f935ff083c1225558a11c9ac20510bc5d
MD5 6a7de0c19119e7c85a29eaf6ae850a7c
BLAKE2b-256 39ab997d747839fb2db8a55696b6d3196e165a1c8741c8b303ad464114b6caf9

See more details on using hashes here.

Provenance

The following attestation bundles were made for crashbytes_apiclient-1.1.4.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.4-py3-none-any.whl.

File metadata

File hashes

Hashes for crashbytes_apiclient-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 116bf396df73d773ef3fcc3a15db7a4a9bdb323d0f2611f14297a061cfd68ef4
MD5 ddca64790e46a89caf69249520d03566
BLAKE2b-256 be191311a3e99d4acf01e72b1b58c412606c9bc1af9c87797f7eb584bc7f9326

See more details on using hashes here.

Provenance

The following attestation bundles were made for crashbytes_apiclient-1.1.4-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