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.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cliver_playbook_app_basic-0.2.1.tar.gz | 36.2 kB | Without provenance | Details for cliver_playbook_app_basic-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cliver_playbook_app_basic-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for cliver_playbook_app_basic-0.2.1-py3-none-any.whl |
Total release size: 76.5 kB
Release files / cliver_playbook_app_basic-0.2.1.tar.gz
| Download URL | cliver_playbook_app_basic-0.2.1.tar.gz |
|---|---|
| Size | 36.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
677770a18e525db1ed45897f84d75dff993bf52ad35cd90e8c1882243b69c7d5
|
|
BLAKE2b-256 checksum How to use checksums |
201a988b86b0dc5dc1888a4c4adc79bec01ff401379923b5ae3aecd47454574e
|
| 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.2.1-py3-none-any.whl
| Download URL | cliver_playbook_app_basic-0.2.1-py3-none-any.whl |
|---|---|
| Size | 40.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1525dd2e4da74acea992fa195202c5d5114ac26d54d78a0b4374cfe7412a9dbb
|
|
BLAKE2b-256 checksum How to use checksums |
0421e3a0107caa72792061c5ca545ea3dc15cb43feca22252254cabce568335c
|
| 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.2.1
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.