⚜️ Clientele
Loveable API Clients from OpenAPI schemasClientele lets you generate fully-typed, loveable Python API Clients from OpenAPI schemas:
from my_api import client, schemas
# Pydantic-typed inputs
data = schemas.RequestDataRequest(my_input="test")
# Easy to read client functions
response = client.request_data_request_data_post(data=data)
# Handle responses elegantly
match response:
case schemas.RequestDataResponse():
# Handle valid response
...
case schemas.ValidationError():
# Handle validation error
...
The generated code is tiny - the example schema we use for documentation and testing only requires 250 lines of code and 5 files.
Choose either sync or async - we support both, and you can switch between them easily:
from my_async_api import client
# Async client functions
response = await client.simple_request_simple_request_get()
All generated from a single command:
# add -asyncio -t to make it async
clientele generate -u https://raw.githubusercontent.com/phalt/clientele/main/example_openapi_specs/best.json -o api_client/
(That works - try it now!)
Other features
- Supports authentication automatically (curently only HTTP Bearer and HTTP Basic auth).
- Written entirely in Python - no need to install any other languages.
- The client footprint only requires
httpxandpydantic. - Support your own configuration - we provide an entry point that will never be overwritten.
- Designed for easy testing with respx.
We're built on:
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 clientele-0.5.1.tar.gz.
File metadata
- Download URL: clientele-0.5.1.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.8.10 Linux/5.15.0-78-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b149cca8634d5487062902866a2d5d14a26695d0d202c5104a08502b5902900
|
|
| MD5 |
dbe21bf7fac2978fa2a49b2294638817
|
|
| BLAKE2b-256 |
beebdc60ee550a493ef34272eb43f742c30df876562da372cefacb409ff75ec4
|
File details
Details for the file clientele-0.5.1-py3-none-any.whl.
File metadata
- Download URL: clientele-0.5.1-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.8.10 Linux/5.15.0-78-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d8c15170b57450f47f28216982cc5119971b4411a9cd123999bba47f6316311
|
|
| MD5 |
7297320bb5a8a0e3f15a4453c2aea753
|
|
| BLAKE2b-256 |
13ea64eb4f19d184427c4050c6790af081cc71c2482c8894ae12b34fd37c997c
|