Automated pipeline that generates and publishes a typed Python client for the Tandoor Recipes REST API.
The client is published to PyPI as tandoor-client and is updated automatically when the upstream API changes.
pip install tandoor-clientfrom tandoor_client import Client
client = Client(base_url="https://your-tandoor-instance.com")
# Use AuthenticatedClient for endpoints requiring authentication
from tandoor_client import AuthenticatedClient
client = AuthenticatedClient(
base_url="https://your-tandoor-instance.com",
token="your-api-token",
)from tandoor_client.api.recipe import recipe_list
from tandoor_client import AuthenticatedClient
client = AuthenticatedClient(
base_url="https://your-tandoor-instance.com",
token="your-api-token",
)
response = recipe_list.sync(client=client)A daily GitHub Actions workflow:
- Checks for new tagged releases in the upstream Tandoor repository
- Compares changed files against known API paths — if no API files changed, stops early
- Extracts the OpenAPI schema via
manage.py spectacular - If the schema differs from the last published version, generates a typed Python client using openapi-python-client
- Publishes to PyPI via Trusted Publisher
The workflow uses GitHub repository variables:
| Variable | Purpose | Example |
|---|---|---|
UPSTREAM_REPO |
Upstream GitHub repository | TandoorRecipes/recipes |
UPSTREAM_URL |
Upstream git URL | https://github.com/TandoorRecipes/recipes.git |
API_PATHS |
Space-separated paths to check for API changes | cookbook/serializer cookbook/views cookbook/urls |
gh workflow run build-and-publish.yml -f force=true