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.2.tar.gz (13.4 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.2-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: clientele-0.5.2.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-83-generic

File hashes

Hashes for clientele-0.5.2.tar.gz
Algorithm Hash digest
SHA256 6235fc6c795e825caabf555e7536856c8f953f9427cbee51bf76d3df922be4b8
MD5 94a98b9963347a60fae0026289c040f6
BLAKE2b-256 6662233243fa8407ae4abd80dfff00b1549d00ff4d0e72132df41d7360a1ff5a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: clientele-0.5.2-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-83-generic

File hashes

Hashes for clientele-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ba02236d8a0115ab97df19ff2eccc0be529298a4ecadbf7ffe8354fe67a8a04f
MD5 c2ac0cd29a6a395fa465a2c9147edc91
BLAKE2b-256 d9aa119053cbfa41a1f3d1eaa163cfd1ded2dae2b23cfa726d264daa7437c79c

See more details on using hashes here.

Release history Release notifications | RSS feed

2.3.0

2 files

2.2.2

2 files

2.2.1

2 files

2.2.0

2 files

2.1.0

2 files

2.0.0

2 files

1.11.1

2 files

1.11.0

2 files

1.10.0

2 files

1.9.2

2 files

1.9.1

2 files

1.9.0

2 files

1.8.1

2 files

1.8.0

2 files

1.7.1

2 files

1.7.0

2 files

1.6.1

2 files

1.6.0

2 files

1.5.0

2 files

1.4.3

2 files

1.4.2

2 files

1.4.1

2 files

1.4.0

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.1

2 files

1.0.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

This release

0.5.2 This release

2 files

0.5.1

2 files

0.5.0

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page