Opinionated toolkit for building robust Python API clients.
Project description
api-client-kit
Work in progress:
api-client-kitis under active early development and is not ready for production use yet.
api-client-kit is an opinionated Python toolkit for building robust API clients.
It helps developers build clean, reliable, testable clients for third-party APIs, internal APIs, SaaS integrations, data providers, service-to-service APIs, and automation workflows.
The package is not a generated SDK framework. It is not a replacement for httpx. It is not only a retry helper.
It is a client engineering kit: a small, composable infrastructure layer for the recurring concerns that appear in real API client development.
Status
Current status:
public repository
package skeleton exists
local development tooling exists
CI exists
runtime API client implementation not started yet
not published to PyPI yet
The package is not ready for production use.
The first intended usable public release is:
api-client-kit==0.1.0
A possible placeholder package release may happen earlier as:
api-client-kit==0.0.1
The purpose of 0.0.1 would be package-name reservation and transparent early project visibility, not production use.
What Problem This Solves
Many API clients start as a simple request:
response = httpx.get(url, headers=headers)
That works until real API behavior appears:
429 Too Many Requests- temporary
500,502,503, and504responses - network timeouts
- connection errors
- token failures
- expiring credentials
- inconsistent pagination formats
- unstructured error payloads
- duplicated retry logic
- duplicated auth logic
- inconsistent sync and async behavior
- secrets leaking into logs or errors
- hard-to-test network behavior
Without a reusable foundation, every project tends to rebuild these pieces differently.
api-client-kit exists to provide shared infrastructure for those concerns.
The Solution
api-client-kit provides reusable primitives for building API clients with consistent behavior around transport, auth, retries, errors, redaction, pagination, hooks, and tests.
The long-term request pipeline is:
build request
→ normalize request context
→ apply auth
→ apply rate-limit policy
→ send request
→ retry if needed
→ decode response
→ raise structured errors
→ return response data
→ emit observability hooks
The goal is to let developers write clean domain-specific endpoint methods while relying on tested infrastructure for lower-level client behavior.
Planned Capabilities
The package is intended to provide reusable primitives for:
- sync and async API clients
- request and response handling
- authentication providers
- retries and backoff
- rate-limit handling
- structured errors
- safe redaction
- pagination helpers
- observability hooks
- test-friendly API client development
v0.1.0 Roadmap
Planned v0.1.0 scope includes:
SyncClientAsyncClient- request options model
- internal request context
- response wrapper
- URL joining
- header merging
- timeout support
- structured error hierarchy
- safe request/response error context
- header, URL, query, and payload redaction helpers
- API key auth
- bearer token auth
- composite auth
- retry policy interface
- default retry policy
- exponential backoff
Retry-Afterparsing- basic rate-limiter interface
- pagination helpers
- observability hook interfaces
- redaction-safe logging hooks
- examples
- public documentation
- CI and release workflow
Non-Goals
api-client-kit is not intended to be:
- a full SDK generator
- an OpenAPI code generator
- a replacement for
httpx - a web framework
- a credential vault
- a distributed rate limiter
- a schema validation framework
- a full tracing or metrics framework
The project focuses on API-client infrastructure primitives first.
Installation
The package is not published yet.
Future installation target:
pip install api-client-kit
For uv users:
uv add api-client-kit
Documentation
Public documentation lives in docs/.
Start here:
Development
This repository is uv-first and remains pip-compatible.
For local setup, checks, testing, build commands, and contribution workflow, see:
Testing Policy
Tests use pytest.
Tests must not call real external APIs.
HTTP behavior should be tested with local test doubles such as httpx.MockTransport.
Feature work should include tests.
Python Support
Primary development Python version:
Python 3.12
Supported Python versions for the first usable release:
Python >=3.10
CI target matrix:
3.10, 3.11, 3.12, 3.13
License
MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 api_client_kit-0.0.1.tar.gz.
File metadata
- Download URL: api_client_kit-0.0.1.tar.gz
- Upload date:
- Size: 113.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
316c33f7a556db74eae8a537f68071358fbc0b09085e5c9b7d491a8a7aa936a3
|
|
| MD5 |
5b3f242dd1c167fc732a17b65355b72e
|
|
| BLAKE2b-256 |
bc4b4a20c5eecb48bcf9be796b7481a5dd4cec6973efd6eae1f21e0b38d352e3
|
File details
Details for the file api_client_kit-0.0.1-py3-none-any.whl.
File metadata
- Download URL: api_client_kit-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a171fba8dbb18acd2f406e5fd52587b8c10ce413a8310442c1b7abdeacc4331
|
|
| MD5 |
a356dcf8b3c611362bb5ff4fb15dbfd8
|
|
| BLAKE2b-256 |
196a1f0e9f24f8c846ad5cf9ce2f11027608dc693dad5481b93ab2b9a4b04f24
|