Skip to main content

cliver-playbook-app-basic

Foundations package of the cliver-playbook library — everything a service needs before business code: layered settings, the process runtime, and one runnable API slice.

What is inside

Area Path (under src/cliver_playbook/app/basic/) Notes
Settings settings.py Layered: env > .env > runtime overrides > app.yaml (Jinja2) > defaults. Subclass Settings to extend (ADR-0016).
Runtime runtime.py configure(settings) binds settings + async engine once per process; nothing is built at import time.
Runtime settings runtime_settings.py Package-owned settings sections: field description, validation, live apply, app_settings persistence and the lifespan overlay (ADR-0021).
Routers api/routes.py ROUTERS: list[APIRouter] — a composed app includes them (ADR-0015).
Pagination schemas/pagination.py, api/pagination.py The shared Page[T] response envelope and the page_params() limit/offset dependency, with per-route bounds.
Demo slice api/items.py, services/, schemas/, models/entities.py Full CRUD example: the items table and /api/v1/items. Optional — delete together with its migration and tests.
Migrations alembic/ Own chain, version table alembic_version_basic; creates items and app_settings.
Application app.py, __main__.py create_app() and python -m cliver_playbook.app.basic.

Pagination

Paginated endpoints return the shared Page[T] envelope and parse their window with page_params(). The factory's bounds are per endpoint; an out-of-range limit or offset is a 422, never a silently clamped request.

from fastapi import Depends

from cliver_playbook.app.basic.api.pagination import PageParams, page_params
from cliver_playbook.app.basic.schemas.pagination import Page


@router.get("", response_model=Page[OrderRead])
async def list_orders(
    params: PageParams = Depends(page_params(default_limit=50, max_limit=200)),
    db: AsyncSession = Depends(get_db),
) -> Page[OrderRead]:
    rows, total = await service.list_orders(db, limit=params.limit, offset=params.offset)
    return Page[OrderRead](
        items=[OrderRead.model_validate(row) for row in rows],
        total=total,
        limit=params.limit,
        offset=params.offset,
    )

total counts the full filtered set, not the rows in items. The identity package's audit listing and the MCP activity feed are the worked examples.

Install

python -m pip install -e .                     # from this directory
# consuming project, same virtualenv (dependency first, then this):
python -m pip install -e ../cliver-playbook-app-basic

Editable installs of sibling packages coexist in one virtualenv: the cliver_playbook and cliver_playbook.app namespace directories are PEP 420 — deliberately no __init__.py — so every package's portion merges.

Run standalone

docker compose up -d db        # or point CLIVER_DATABASE_URL at PostgreSQL
python -m cliver_playbook.app.basic --reload
# GET /api/v1/health, /api/v1/version, /api/v1/items

Configuration resolves relative to the current working directory: the nearest ancestor containing app.yaml or .env is the application root (CLIVER_CONFIG_FILE overrides). See settings.py and config_yaml.py.

Migrate

python -c "from cliver_playbook.app.basic.alembic import run_migrations_online; run_migrations_online()"
# interactive, from this directory:
alembic upgrade head

Test

python -m pytest        # needs PostgreSQL; creates and drops a temp database

Metadata

Release files for cliver-playbook-app-basic 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cliver-playbook-app-basic 0.3.0
File Size Uploaded Provenance Actions
cliver_playbook_app_basic-0.3.0.tar.gz 36.3 kB Without provenance Details for cliver_playbook_app_basic-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cliver-playbook-app-basic 0.3.0
File Interpreter ABI Platform Actions
cliver_playbook_app_basic-0.3.0-py3-none-any.whl Python 3 none any Details for cliver_playbook_app_basic-0.3.0-py3-none-any.whl

Total release size: 76.5 kB

Release files / cliver_playbook_app_basic-0.3.0.tar.gz

Download URL cliver_playbook_app_basic-0.3.0.tar.gz
Size 36.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3a2afc2ab22ff1dcde52accea158a95318871030513ed21f9f65167699a4b05e
BLAKE2b-256 checksum
How to use checksums
e075c28611d8c7f784c04bd8895bcabbc66bd272919d372390c659b4f65cdd32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cliver_playbook_app_basic-0.3.0-py3-none-any.whl

Download URL cliver_playbook_app_basic-0.3.0-py3-none-any.whl
Size 40.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da5f482a92467b4f5af04ce801ad21d6f448e7b6d4ec57ef677f6a74c8c78b52
BLAKE2b-256 checksum
How to use checksums
61280e74f307b82d42c6eace848f0e72a26aa5d4b7cb948763b2813dea9ee9c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for cliver-playbook-app-basic 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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