Metadata-Version: 2.4
Name: crashbytes-apiclient
Version: 1.1.0
Summary: httpx API client toolkit — pagination, retry, rate limiting, auth refresh, middleware.
Project-URL: Homepage, https://github.com/CrashBytes/crashbytes-apiclient
Project-URL: Repository, https://github.com/CrashBytes/crashbytes-apiclient
Project-URL: Issues, https://github.com/CrashBytes/crashbytes-apiclient/issues
Author-email: CrashBytes <crashbytes@users.noreply.github.com>
License-Expression: MIT
License-File: LICENSE
Keywords: api-client,httpx,middleware,pagination,retry
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx>=0.28
Provides-Extra: dev
Requires-Dist: mypy>=1.20; extra == 'dev'
Requires-Dist: pytest-asyncio>=1.3; extra == 'dev'
Requires-Dist: pytest-cov>=7.1; extra == 'dev'
Requires-Dist: pytest-httpx>=0.36; extra == 'dev'
Requires-Dist: pytest>=9.0; extra == 'dev'
Requires-Dist: ruff>=0.15; extra == 'dev'
Description-Content-Type: text/markdown

# crashbytes-apiclient

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

## Install

```bash
pip install crashbytes-apiclient
```

## Usage

```python
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
