{"id":16487190,"url":"https://github.com/phalt/clientele","last_synced_at":"2026-01-23T18:17:21.973Z","repository":{"id":182747765,"uuid":"669029134","full_name":"phalt/clientele","owner":"phalt","description":"A different way to build Python API Clients","archived":false,"fork":false,"pushed_at":"2026-01-11T13:09:42.000Z","size":17850,"stargazers_count":121,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-11T16:03:25.981Z","etag":null,"topics":["api","api-rest","asyncio","django-ninja","django-rest-framework","fastapi","httpx","openapi","pydantic","python"],"latest_commit_sha":null,"homepage":"http://docs.clientele.dev/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phalt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-07-21T07:13:34.000Z","updated_at":"2026-01-11T15:33:07.000Z","dependencies_parsed_at":"2023-11-17T20:29:22.588Z","dependency_job_id":"c0d4753a-9c06-47b0-8990-dd521f01c55f","html_url":"https://github.com/phalt/clientele","commit_stats":null,"previous_names":["beckett-software/beckett-api","beckett-software/clientele","phalt/clientele"],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/phalt/clientele","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalt%2Fclientele","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalt%2Fclientele/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalt%2Fclientele/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalt%2Fclientele/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phalt","download_url":"https://codeload.github.com/phalt/clientele/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalt%2Fclientele/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28547004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T14:59:57.589Z","status":"ssl_error","status_checked_at":"2026-01-18T14:59:46.540Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-rest","asyncio","django-ninja","django-rest-framework","fastapi","httpx","openapi","pydantic","python"],"created_at":"2024-10-11T13:33:06.253Z","updated_at":"2026-01-23T18:17:21.966Z","avatar_url":"https://github.com/phalt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚜️ Clientele\n\n![https://raw.githubusercontent.com/phalt/clientele/refs/heads/main/docs/clientele_header.png](https://raw.githubusercontent.com/phalt/clientele/refs/heads/main/docs/clientele_header.png)\n\n[![Package version](https://img.shields.io/pypi/v/clientele?color=%2334D058\u0026label=latest%20version)](https://pypi.org/project/clientele)\n![Python versions](https://img.shields.io/badge/python-3.10+-blue)\n![PyPI - License](https://img.shields.io/pypi/l/clientele)\n[![codecov](https://codecov.io/github/phalt/clientele/graph/badge.svg?token=7OH7QLCGBM)](https://codecov.io/github/phalt/clientele)\n[![PyPI Downloads](https://static.pepy.tech/personalized-badge/clientele?period=total\u0026units=INTERNATIONAL_SYSTEM\u0026left_color=GREY\u0026right_color=GREEN\u0026left_text=Downloads)](https://pepy.tech/projects/clientele)\n\n![Pydantic Badge](https://img.shields.io/badge/Data_validation-pydantic-violet?style=flat)\n![Http Badge](https://img.shields.io/badge/HTTP-Customisable-blue?style=flat)\n\n## Example code\n\n```python\nfrom clientele import api\nfrom pydantic import BaseModel\n\nclient = api.APIClient(base_url=\"https://pokeapi.co/api/v2/\")\n\nclass Pokemon(BaseModel):\n    name: str\n\n@client.get(\"/pokemon/{id}\")\ndef get_pokemon_name(id: int, result: Pokemon) -\u003e str:\n    return result.name\n```\n\n[See more examples](https://docs.clientele.dev/api-examples/)\n\n## Why use Clientele?\n\n- **A comfortable abstraction** - Encourages consistency and focus on the functionality.\n- **Easy to learn** - Clientele is visually similar to popular python API server frameworks.\n- **Easy to test** - Comes with built-in testing tools.\n- **Easy to configure** - Sensible HTTP defaults and plenty of hooks for customisation.\n- **Easy data validation** - Built in data validation using [Pydantic](https://docs.pydantic.dev/latest/).\n- **Core built-ins** - Caching, Network, and Retry handling built specifically for HTTP.\n- **Use your own HTTP** - Clientele can support any Python HTTP library.\n- **OpenAPI support** - Build your own client, or scaffold one from an OpenAPI schema.\n\n## Async support\n\n```python\n@client.get(\"/pokemon/{id}\")\nasync def get_pokemon_name(id: int, result: Pokemon) -\u003e str:\n    return result.name\n```\n\n## Automatic data validation\n\n```python\nfrom clientele import api as clientele_api\nfrom .my_pydantic_models import CreateBookRequest, CreateBookResponse\n\nclient = clientele_api.APIClient(base_url=\"http://localhost:8000\")\n\n\n@client.post(\"/books\")\ndef create_book(data: CreateBookRequest, result: CreateBookResponse) -\u003e CreateBookResponse:\n    return result\n```\n\n## Streaming responses\n\n```python\nfrom typing import AsyncIterator\n\nfrom clientele import api\nfrom pydantic import BaseModel\n\n\nclient = api.APIClient(base_url=\"https://httpbin.org\")\n\n\nclass Event(BaseModel):\n    id: int\n    url: str\n\n\n@client.get(\"/stream/{n}\", streaming_response=True)\nasync def stream_events(n: int, result: AsyncIterator[Event]) -\u003e AsyncIterator[Event]:\n    return result\n```\n\n## Works with Python API frameworks\n\nBuilding an API service in Python? Clientele can build you a client library in seconds.\n\nClientele is built and tested to be 100% compatible with the OpenAPI schemas generated from:\n\n- **FastAPI**\n- **Django REST Framework** via **drf-spectacular**\n- **Django Ninja**\n\nSee the working demos in our [`server_examples/`](https://github.com/phalt/clientele/tree/main/server_examples) directory.\n\n## OpenAPI support\n\nClientele can create scaffolding for an API client from an OpenAPI schema with:\n\n- **Pydantic models** generated from the schema objects.\n- **Decorated function signatures** generated from schema operations.\n- **Async support** if you want a client with concurrency.\n- **A tiny output** that is only 3 files big.\n- **Regeneration-friendly** - update your API, regenerate, review the git diff, then ship it!\n- **Formatted code** thanks to [Ruff](https://docs.astral.sh/ruff/).\n\n![generate_gif](https://raw.githubusercontent.com/phalt/clientele/refs/heads/main/docs/clientele_generate.gif)\n\n## Getting Started\n\n👉 Read the [full documentation](https://docs.clientele.dev/) for all documentation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphalt%2Fclientele","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphalt%2Fclientele","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphalt%2Fclientele/lists"}