Skip to content

featurecreep-cron/tandoor-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tandoor API Client Auto-Publisher

CI License: MIT PyPI Python

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.

Installation

pip install tandoor-client

Usage

from 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",
)

Example: List Recipes

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)

How It Works

A daily GitHub Actions workflow:

  1. Checks for new tagged releases in the upstream Tandoor repository
  2. Compares changed files against known API paths — if no API files changed, stops early
  3. Extracts the OpenAPI schema via manage.py spectacular
  4. If the schema differs from the last published version, generates a typed Python client using openapi-python-client
  5. Publishes to PyPI via Trusted Publisher

Configuration

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

Manual Trigger

gh workflow run build-and-publish.yml -f force=true

About

Auto-generated Python client for the Tandoor Recipes API

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors

Languages