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.4.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.4.0
File Size Uploaded Provenance Actions
cliver_playbook_app_basic-0.4.0.tar.gz 36.3 kB Without provenance Details for cliver_playbook_app_basic-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 76.5 kB

Release files / cliver_playbook_app_basic-0.4.0.tar.gz

Download URL cliver_playbook_app_basic-0.4.0.tar.gz
Size 36.3 kB
Tags Source
SHA-256 checksum
How to use checksums
798c45fdb7ee71a7bfdb98a22f001da7e3ae56e6dc8ca59e8881f5d6177ed698
BLAKE2b-256 checksum
How to use checksums
ead754f1505f65d5761eecc2504333595f9594b6db95438b5ee395c14b0febd5
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.4.0-py3-none-any.whl

Download URL cliver_playbook_app_basic-0.4.0-py3-none-any.whl
Size 40.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
41c03e101f6df45f663671a86c29601ca5e8154abf0c3d26a51b35d79ec8a510
BLAKE2b-256 checksum
How to use checksums
8c88b513a2ed407a7b0f13b3d847d12283b0374a410cb16e16b839180002c2b9
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.4.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