Skip to main content

⚜️ Clientele

Loveable API Clients from OpenAPI schemas

Package version Supported Python versions

Clientele 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 httpx and pydantic.
  • 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

clientele-0.5.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

clientele-0.5.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file clientele-0.5.0.tar.gz.

File metadata

  • Download URL: clientele-0.5.0.tar.gz
  • Upload date:
  • Size: 13.3 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

Hashes for clientele-0.5.0.tar.gz
Algorithm Hash digest
SHA256 4ad0da8921810ef23f52275a9ac7848b687509cbfd10f1b0a426b207c4f4abbb
MD5 22ab3d5675f26e2e56c48d00917c8cc4
BLAKE2b-256 8f48541ce1350a916f135d492da5f7b0dd1d21ce02b8f2e7cc5cb323cee6f5d2

See more details on using hashes here.

File details

Details for the file clientele-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: clientele-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 18.2 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

Hashes for clientele-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5feee2adac8782cad3492aea9e7e01f3ffbe6128bf360f18b5c01919a039b79
MD5 9c9c4cb17f9de36762feb979c52a1f63
BLAKE2b-256 0c235fbd4025dc434a20da4183a65dc3ffdc72fce14d9f78957c7624e2811202

See more details on using hashes here.

Supported by

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