compendium-ils 1.6.3
https://ift.tt/LcrS752
Compendium
A catalog and circulation system for physical collections, including books, vinyl, DVDs, and CDs.
Features
- Catalog — add items using an ISBN, UPC, MusicBrainz ID, TMDb ID, or title search (Google Books / Open Library, MusicBrainz, TMDb); enter less common items manually; find and browse works and copies; discover items using facets such as media type, decade, and availability
- Recoverable work deletion — deleted works, along with their copies, loan and hold history, notes, creator links, and curated-list memberships, are moved to trash. Restore them from Recently Deleted,
compendium work trash, or the API. Deletion is blocked if copies are on loan or have unpaid fines; holds are cancelled. Trashed works are automatically purged after a configurable period (COMPENDIUM_TRASH_RETENTION_DAYS, 90 days by default) - Circulation — check out and check in items, renew loans, and apply category-aware loan policies by media type; track lost, damaged, and claims-returned items; offer self-checkout kiosk mode; configure library hours and holidays so due dates avoid closed days and overdue fines skip them
- Holds — manage patron reservation queues, promote holds as soon as copies become available, suspend or resume holds, and expire them with a maintenance command
- Fines — set overdue rates, caps, and grace periods by policy; charge for lost or damaged items; block checkouts or holds at configured thresholds; manage payments and waivers; assess fines for individual patrons or in bulk
- Notifications — queue email using the outbox pattern for holds ready for pickup, upcoming due dates, and overdue items; send queued messages with a cron-triggered CLI command; review and retry messages in the admin interface; configure patron opt-outs and retention
- Reports — view monthly checkouts, popular works, inactive items for weeding, and current overdue loans; export CSV data and view Chart.js trend lines
- Patrons & cards — use seeded patron categories (Adult/Child/Staff/Teacher); set card expiry and automatically deactivate expired cards through maintenance; optionally link a patron to a user account for self-service
- Bulk import/export — import and export round-trippable CSV, binary MARC21, and MARCXML; import LibraryThing TSV, GoodReads CSV, and Discogs collection CSV files. All formats support lenient encoding for real-world exports.
- Backup/restore — create portable JSONL tarball backups; move data between SQLite and Postgres; use backups as a database migration route
- Labels — create Avery-template item labels (spine / pocket) and patron cards (full / sticker) as PDFs. Spine templates include
avery-5167-spine(½" narrow face),avery-5160-spine(1" medium face, rotated),avery-5160(flat wrap-around, centered text), andavery-22805/avery-22806(square classification labels). An interactive SVG preview updates as you change the type, template, or fields—without generating a PDF first. - Curated lists — create named collections of works, such as "Staff picks" or "Summer reads," with librarian editing, slugs, annotations for each work, and public/private and featured options. Featured lists appear as a shelf on the OPAC landing page; browse public lists at
/ui/lists - Auth — choose from five preset roles (ReadOnly, Patron, Librarian, SystemAdmin, Administrator) or create custom roles in the admin interface; use JWT authentication for the API and cookies for the web UI
- Audit log — keep a synchronous record of administrative changes (Librarian and system tiers); search the log through the web UI, CLI, or REST API
- DB-editable settings — configure most options, including library name, fines, kiosk timeout, SMTP, retention, and navigation shortcuts, through the UI, CLI, or API. Environment variables remain available as emergency overrides.
- Remote phone scanner — pair a phone with the circulation desk using a QR code. The phone can send scans to the desk in real time without an app, supporting checkout, checkin, and catalog lookup. Pairing uses a temporary claim secret in the QR code; after the phone claims it, the secret is replaced with a session cookie. Librarians can unpair from the desk at any time. Camera access requires HTTPS on the server and phone browser (a secure context). Configure
public_base_url(DB-editable; envCOMPENDIUM_PUBLIC_BASE_URL) andscan_session_minutes(DB-editable; envCOMPENDIUM_SCAN_SESSION_MINUTES; default 60). - Circulate by ISBN/UPC — use a book’s printed ISBN barcode or a disc’s UPC to check out, check in, or renew an item instead of scanning its Compendium label. If multiple copies of a title are on loan, checkin asks the desk to identify the returned copy. Enable or disable this feature with
circulation_scan_isbn_enabled(envCOMPENDIUM_CIRCULATION_SCAN_ISBN_ENABLED, on by default) under Admin → Settings → Circulation. - Web UI — browse a HTMX + Jinja2 interface with catalog search, a circulation desk with camera barcode scanning, patron self-service, light/dark/automatic themes, and per-user navigation shortcuts stored in browser localStorage
- REST API — a FastAPI interface used by the web UI and available for integrations
- CLI — run librarian and system administrator workflows without a server; supports stdin/stdout (
-) for backups, imports, exports, and labels
Install
# Install the CLI as a standalone tool (recommended for production)
uv tool install compendium-ils # SQLite only
uv tool install "compendium-ils[postgres]" # + Postgres support
# Or with pip
pip install compendium-ils
pip install "compendium-ils[postgres]"
The installed executable is called compendium.
Quick start
Quick start (Docker)
Launch with a single command. You only need Docker and its compose plugin:
curl -fsSL https://raw.githubusercontent.com/statyk/compendium/master/install.sh | sh
The command creates a deployment in ./compendium/ with a compose file, nginx configuration, and generated secrets, then starts the services. If the package is already installed, run compendium init ./compendium to create the deployment files without starting them. See docs/deployment.md for more information.
Prerequisites
Python 3.11.4 or later is required. Backup restore uses the tarfile data filter from PEP 706, backported to Python 3.11.4.
Debian / Ubuntu
sudo apt-get update
sudo apt-get install -y python3 python3-venv python3-dev build-essential
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env
RedHat / CentOS / Fedora
sudo dnf install -y python3 python3-devel gcc
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env
macOS
brew install python uv
Run
# Install dependencies
uv sync --extra dev
# Initialise the database (creates ./compendium.db with SQLite by default)
uv run compendium db init
# Create an Administrator account
uv run compendium user add --username admin --role Administrator
# Add a book by ISBN (looks up metadata from Google Books when key is set, else Open Library)
uv run compendium item add --isbn 9780441013593
# Add a patron
uv run compendium patron add --name "Alice Example"
# Start the server (web UI at http://localhost:8000/ui/catalog)
uv run compendium serve
Sign in at http://localhost:8000/ui/login using the username and password you created.
CLI reference
Use compendium --help to see all commands, or compendium <group> --help to view commands within a group.
Catalog & cataloging
| Group | Common subcommands |
|---|---|
item |
add (–isbn / –upc / –mbid / –tmdb-id / –title), add-manual, show, edit (location/call-number/condition/notes/loanable), withdraw; note add/list/delete; declare-lost, mark-damaged, clear-lost, clear-damage |
work |
list, search, show, new-arrivals, recently-returned, delete; trash list/restore/purge |
creator |
edit |
curated-list |
add, list, show, edit, delete, add-work, remove-work, reorder |
branch |
list, edit |
import |
csv, marc (use - for stdin) |
export |
csv, marc (use - for stdout) |
Circulation
| Group | Common subcommands |
|---|---|
loan |
checkout, checkin, renew, active, list (system-wide), history, item-history |
claim |
returned (patron disputes), verify (found), write-off, list |
hold |
place, cancel, list, queue, suspend, resume, list-suspended |
fine |
list, pay, waive, assess, assess-overdue |
Patrons & accounts
| Group | Common subcommands |
|---|---|
patron |
add, list (--include-inactive), edit, link-user, unlink-user, add-user, deactivate, reactivate |
patron-category |
list, add, edit, delete |
user |
add (default –role Administrator), list (--include-inactive), edit (role and/or password), deactivate, reactivate |
role |
list, add, edit, clone |
policy |
list, add, edit (configures fines by patron category) |
Reporting & labels
| Group | Common subcommands |
|---|---|
reports |
checkouts, popular, dormant, overdues (each supports --format csv) |
labels |
templates, spine, pocket, barcode, patron-card, patron-sticker (use -o - to write the PDF to stdout; use --show/--hide to toggle fields, such as --show barcode for spine labels) |
audit |
list (filters: --entity, --id, --user-id, --limit) |
Operations
| Command | Description |
|---|---|
compendium db init / db upgrade / db history |
Apply or inspect database migrations |
compendium serve |
Launch the API and web UI |
compendium backup --output <path-or-> |
Create a portable JSONL tarball backup |
compendium restore <path-or-> |
Load a backup tarball (lenient; upgrades automatically) |
compendium settings list/get/set/reset |
View and change database-backed site settings |
compendium maintenance ... |
Run scheduled tasks: expire-holds, resume-expired-suspends, assess-overdue-fines, queue-due-soon-notices, queue-overdue-notices, send-queued-notifications, prune-notifications, prune-audit-log, deactivate-expired-patrons, prune-cover-cache, prune-metadata-cache, prune-scan-pairings, refresh-metadata, purge-trash |
compendium metadata cache stats |
Display metadata cache counts by adapter and expiry status |
compendium metadata cache clear |
Remove all metadata cache entries (recorded in the audit log) |
Commands that take file arguments (backup, restore, import, export, labels spine/pocket/barcode/patron-card/patron-sticker) accept - for stdin or stdout. In stdio mode, status messages go to stderr to keep binary output intact.
All list and show commands support --format table|json. The default, table, displays a readable rich table; json outputs stable, script-friendly JSON to stdout, with snake_case keys, ISO-8601 UTC datetimes, and integer cents. Notices are sent to stderr so output can be piped cleanly. See docs/architecture.md for the full JSON contract, including the reports group’s date-only string exception. For example:
compendium loan list --format json | jq '.[].due_at'
Web UI
Run compendium serve, then visit http://localhost:8000/ui/catalog in a browser.
"Audience" shows the lowest preset role permitted to access each route. Administrator has access to all routes. SystemAdmin can access System-tier rows, while slimmed Librarian can access librarian-tier rows but not System-tier rows.
| URL | Audience | Description |
|---|---|---|
/ui/catalog |
Anyone | Search the catalog with media type, decade, and availability facets; view featured curated lists |
/ui/catalog/{work_id} |
Anyone | View work details and copies, and place a hold |
/ui/lists |
Anyone | Browse public curated lists in the OPAC |
/ui/lists/{slug} |
Anyone | View a public curated list and its annotated works |
/ui/login |
Anyone | Sign-in page |
/ui/me/loans |
Patron | View active loans, renew inline, or submit an "I returned this" claim |
/ui/me/holds |
Patron | View active holds, cancel them, or suspend and resume them inline |
/ui/me/fines |
Patron | See outstanding and past fines |
/ui/me/preferences |
Patron | Manage notification preferences |
/ui/me/password |
Patron | Change a password through self-service |
/ui/circ |
Librarian | Circulation desk for checkout, checkin, and renewal |
/ui/kiosk |
Librarian | Self-checkout kiosk landing page and sessions (patrons authenticate with card number only) |
/ui/items/new |
Librarian | Add an item by ISBN, UPC, MBID, TMDb ID, or title search; includes barcode scanning |
/ui/items/new/manual |
Librarian | Manually catalog an item unavailable from external sources |
/ui/items/{barcode} |
Librarian | View item details and loan history; withdraw or edit items (including loanable status); manage lost, damaged, and claims actions |
/ui/patrons |
Librarian | Browse patrons |
/ui/patrons/new |
Librarian | Add a patron with a category and expiry date |
/ui/patrons/{card} |
Librarian | View patron details, active loans, and holds; link or unlink a user; deactivate or reactivate the patron |
/ui/patrons/{card}/loans |
Librarian | Review loan history by active, returned, or all loans |
/ui/patrons/{card}/fines |
Librarian | Review patron fines and record payment or waiver |
/ui/admin/loans |
Librarian | View all active loans across the system and filter for overdue or due-soon items |
/ui/admin/fines |
Librarian | View outstanding fines across the system, including a running total |
/ui/admin/holds |
Librarian | Browse active holds by status, branch, or work |
/ui/admin/claims |
Librarian | Investigate unresolved claims-returned cases |
/ui/admin/notifications |
Librarian | Review the notification log and retry messages |
/ui/admin/import |
Librarian | Import CSV, GoodReads CSV, LibraryThing TSV, Discogs CSV, or MARC files in bulk |
/ui/admin/export |
Librarian | Export catalog data in bulk as CSV or MARC |
/ui/admin/patron-categories |
Librarian | Edit patron categories |
/ui/curated-lists |
Librarian | Create, view, update, and delete curated lists (curatedlist.manage) |
/ui/trash |
Librarian | Recently Deleted: restore trashed works or delete them permanently (work.delete) |
/ui/admin/settings/general |
Librarian | Configure the library name, default theme, and guest search |
/ui/admin/settings/circulation |
Librarian | Set currency, fine thresholds, and default hold, overdue, and due-soon values |
/ui/admin/settings/kiosk |
Librarian | Set the kiosk idle timeout |
/ui/scan/pair |
Librarian | Create a QR code to connect a phone as a remote barcode scanner |
/ui/scan/desk |
Librarian | View live scan counts and unpair an active phone session |
/ui/scan/phone/* |
Phone browser | Claim the session, choose a mode, and scan continuously using the camera (HTTPS / secure context required) |
/ui/policies |
Librarian | View and edit loan policies inline |
/ui/policies/new |
Librarian | Create a loan policy for a media type and patron category |
/ui/branches |
Librarian | View branches and their classification schemes |
/ui/branches/{id}/edit |
Librarian | Change a branch’s default classification scheme |
/ui/reports |
Librarian | Open the reports dashboard for checkouts, popular works, dormant items, and overdues |
/ui/labels |
Librarian | Create item-label and patron-card PDFs using Avery templates |
/ui/audit |
Librarian | Browse the audit log |
/ui/users |
SystemAdmin | Browse users |
/ui/users/new |
SystemAdmin | Add a user account |
/ui/users/{username} |
SystemAdmin | View user details; change roles, deactivate or reactivate accounts, and reset passwords |
/ui/roles |
SystemAdmin | Browse roles |
/ui/roles/new |
SystemAdmin | Create a custom role |
/ui/roles/{id} |
SystemAdmin | Edit role permissions or make a copy of a role |
/ui/admin/system/smtp |
SystemAdmin | Configure the SMTP host, port, and sender address |
/ui/admin/system/secrets |
SystemAdmin | Manage encrypted secrets (SMTP password, TMDb / Google Books API keys); requires COMPENDIUM_SECRET_KEY |
/ui/admin/system/retention |
SystemAdmin | Configure notification and audit retention, plus batch sizes |
Guest catalog search is on by default. Change this at /ui/admin/settings/general or set COMPENDIUM_GUEST_SEARCH_ENABLED=false.
ISBN/UPC circulation fallback is also on by default. Turn it off at /ui/admin/settings/circulation or set COMPENDIUM_CIRCULATION_SCAN_ISBN_ENABLED=false.
REST API endpoints
API routes are mounted at the root. Sign in with POST /auth/login, then send the returned token in Authorization: Bearer <token>. While the server is running, interactive API documentation is available at http://localhost:8000/docs.
This table summarizes key endpoints by area. Refer to the OpenAPI document for complete parameter and request-body details.
| Group | Common endpoints | Min permission |
|---|---|---|
| Auth | POST /auth/login |
none |
| Catalog | GET /works/search, /works/new-arrivals, /works/recently-returned; GET /items/{barcode}; POST /items/{barcode}/{withdraw,loanable,lost,damaged,clear-lost,clear-damage}; DELETE /works/{id} |
guest / item.view / item.delete / fine.manage / work.delete |
| Trash | GET /trash, POST /trash/{id}/restore, DELETE /trash/{id} |
work.delete |
| Patrons | GET/POST /patrons, PATCH /patrons/{card}, POST /patrons/{card}/{deactivate,reactivate}, POST /patrons/{card}/account, GET/POST /patron-categories, PATCH/DELETE /patron-categories/{id} |
patron.manage / patron.account.manage for account endpoints |
| Loans | POST /loans/checkout, /loans/{id}/{checkin,renew}; GET /loans (system-wide), /loans/patron/{card}, /loans/item/{barcode} |
loan.* (see below) |
| Claims | GET /claims; POST /claims/{barcode}/{returned,verify,write-off} |
loan.checkin |
| Holds | GET /holds, /holds/queue/{work_id}; POST/DELETE /holds, /holds/{id}; POST /holds/{id}/{suspend,resume} |
hold.* |
| Fines | GET /fines, GET/POST /patrons/{card}/fines, POST /fines/{id}/{pay,waive}, POST /patrons/{card}/fines/assess-overdue |
fine.manage / fine.view.self |
| Self-service | GET /me/loans, /me/holds; POST /me/holds, /me/holds/{id}/{suspend,resume}; DELETE /me/holds/{id}; POST /me/loans/{id}/{renew,claim-returned} |
*.self permissions |
| Notifications | GET /notifications, POST /notifications/{id}/retry |
notification.manage |
| Reports | GET /reports/{checkouts,popular,dormant,overdues} |
report.view |
| Bulk import/export | POST /import/{csv,goodreads,librarything,marc} (multipart), GET /export/{csv,marc} (streaming) |
catalog.import / item.view |
| Labels | GET /labels/items, /labels/patrons (PDF) |
labels.generate |
| Policies | GET/POST /policies |
item.view / policy.edit |
| Users | POST /users, POST /users/{username}/{deactivate,reactivate}, POST/DELETE /users/{username}/patron |
user.manage |
| Curated lists | GET/POST /curated-lists, PATCH/DELETE /curated-lists/{slug}, POST/DELETE /curated-lists/{slug}/works |
guest / curatedlist.manage |
| Settings | GET /settings/, GET/PATCH/DELETE /settings/{key} |
patron.manage (librarian-tier) / system.manage (system-tier) |
| Calendar | GET /library-hours/, PATCH /library-hours/{weekday}; GET/POST /closed-dates/, PATCH/DELETE /closed-dates/{id} |
calendar.manage |
| Audit | GET /audit/ |
audit.view |
The "min permission" column identifies the lowest preset role with access. Administrator’s wildcard permission grants access to everything. Slimmed Librarian has librarian-tier access, while SystemAdmin has access to user, role, and system-tier endpoints.
Configuration
Compendium resolves settings from three sources, in this precedence order:
- Environment variable (
COMPENDIUM_<KEY>) — highest-priority emergency override. site_settingtable — database-backed values that can be changed in/ui/admin/settings/*, through the CLI (compendium settings ...), or through the API (PATCH /settings/{key}). Updates apply on the next page render, without a restart.- Registry default — the fallback value defined in
services/settings_registry.py.
Most options, including the library name, theme, fine thresholds, hold and overdue defaults, kiosk timeout, SMTP host/port/from, and retention, can be edited in the database. Some remain environment-only because they are secrets or are needed before the database can be accessed:
| Env var | Why env-only |
|---|---|
COMPENDIUM_DATABASE_URL |
Bootstrap setting required before the application can read the database |
COMPENDIUM_JWT_SECRET_KEY |
Secret key that is required; the server will not start with the built-in default. Generate one with python -c "import secrets; print(secrets.token_urlsafe(48))". Set COMPENDIUM_ALLOW_INSECURE_JWT=1 only to bypass the check during initial setup or development. |
COMPENDIUM_JWT_ALGORITHM / COMPENDIUM_JWT_EXPIRE_MINUTES |
Authentication deployment options |
COMPENDIUM_SSL_CERTFILE / COMPENDIUM_SSL_KEYFILE |
Paths to operating-system files |
COMPENDIUM_SECURE_COOKIES |
Defaults to true. Set to false only for plain-HTTP LAN deployments; browsers do not send Secure cookies over HTTP, except on localhost. |
COMPENDIUM_SECRET_KEY |
Encrypts secrets stored in the database, such as SMTP credentials and API keys. Optional; set it to enable /ui/admin/system/secrets. Generate a key with compendium keygen --secret. |
COMPENDIUM_TMDB_API_KEY |
TMDb API key. This environment value overrides the key configured under Admin → System → Secrets when COMPENDIUM_SECRET_KEY is set. |
COMPENDIUM_GOOGLE_BOOKS_API_KEY |
Google Books API key, used as the primary book metadata source when configured. The environment value overrides the key in Admin → System → Secrets when COMPENDIUM_SECRET_KEY is set. |
COMPENDIUM_BOOK_METADATA_SOURCE_PREFERENCE |
Select the primary book metadata source: googlebooks (default; uses Google Books when a key exists, otherwise Open Library) or openlibrary. Also configurable in the database under Admin → System → Metadata Sources. |
COMPENDIUM_BOOK_METADATA_FALLBACK_ENABLED |
When true (the default), a miss from the primary book metadata adapter triggers a lookup with the secondary adapter (GB→OL and OL→GB). Set to false to turn off fallback. Editable under Admin → System → Metadata Sources. |
COMPENDIUM_METADATA_CACHE_TTL_DAYS |
Number of days to cache successful metadata lookups (default 30). Failed lookups expire after 24 hours. Editable under Admin → System → Metadata Sources. |
COMPENDIUM_SMTP_PASSWORD |
SMTP password. An environment value overrides the password configured under Admin → System → Secrets when COMPENDIUM_SECRET_KEY is set. |
COMPENDIUM_MAX_UPLOAD_BYTES |
Maximum upload size for bulk imports (default 100 MB / 104857600). Kept environment-only so an exposed admin token cannot increase the limit. |
COMPENDIUM_LOGIN_MAX_FAILURES |
Maximum consecutive login failures before an identity is throttled (default 10). Editable in the database under System → Security. |
COMPENDIUM_LOGIN_FAILURE_WINDOW_SECONDS |
Failure-counting window in seconds (default 300, or 5 minutes). Editable in the database under System → Security. |
COMPENDIUM_PUBLIC_BASE_URL |
Public HTTPS origin used when creating phone-pairing QR codes (for example, https://library.example.org). Normally derived from the request, including X-Forwarded-Proto; the included nginx configuration sets this header, so the Docker deployment works without this setting. Configure it if your proxy omits the header or you want to use a specific hostname. Non-HTTPS values are rejected when rendering a QR code. Editable under Admin → Settings → General; the environment value takes precedence. |
COMPENDIUM_SCAN_SESSION_MINUTES |
Duration, in minutes, of an active phone scanner session (default 60). Editable under Admin → Settings → General; the environment value takes precedence. |
COMPENDIUM_TRASH_RETENTION_DAYS |
Number of days a deleted work remains restorable before compendium maintenance purge-trash permanently removes it (default 90; set to 0 to disable automatic time-based purging and allow manual purges only). Editable under Admin → Settings → General (compendium settings set trash_retention_days / PATCH /settings/trash_retention_days); the environment value takes precedence. |
To inspect other settings, run compendium settings list. It displays each value, its source (environment, database, or default), and help text. The web admin page provides the same information and marks settings masked by environment variables with an "⚠ Overridden by env var" indicator.
For comprehensive deployment instructions, see docs/deployment.md. For the bundled Docker Compose deployment (app, Postgres, and nginx with automatically generated self-signed TLS), see docker/README.md.
Docker quick start
A multi-architecture image for linux/amd64 and linux/arm64 is published to GitHub Container Registry with each release:
cd docker
cp .env.example .env && $EDITOR .env # set passwords and JWT secret
docker compose pull
docker compose up -d
The image is ghcr.io/statyk/compendium. Each release publishes the latest, X.Y.Z, and X.Y tags. To pin a release, set COMPENDIUM_IMAGE=ghcr.io/statyk/compendium:1.0.2 in .env.
PostgreSQL
SQLite is the default and works well for home and classroom collections of up to around 10,000 items. PostgreSQL is recommended for larger catalogs or multiple writers working concurrently:
uv sync --extra postgres
Set the database URL:
COMPENDIUM_DATABASE_URL=postgresql+psycopg://compendium:<password>@localhost:5432/compendium
Then apply migrations with compendium db init. For instructions on creating the database and role, configuring TLS, and setting up backups, see docs/deployment.md.
Scheduled maintenance
Some maintenance tasks should run regularly. In particular, the email outbox needs to be drained with send-queued-notifications; otherwise queued messages will not be sent. Install the included crontab with:
scripts/install-cron.sh
By default, the installer records the project path in the crontab and writes logs to $HOME/.local/state/compendium/maintenance.log. Use flags to customize either setting:
scripts/install-cron.sh --project-dir /opt/compendium --log-file journal
scripts/install-cron.sh --log-file /var/log/compendium/maintenance.log
Choose --log-file journal to send output to the systemd journal; view it with journalctl -t compendium-maintenance -f. If the installer cannot create a path without elevated privileges (for example, under /var/log/...), it prints a one-time sudo command and exits without changing the crontab.
For the complete schedule, see docs/crontab.sample. To run the service as a systemd daemon, see docs/compendium.service.sample.
Running tests
uv run pytest -q
The suite includes tests/unit/ (no database; repositories are mocked) and tests/integration/ (in-memory SQLite).
Browser tests (E2E)
End-to-end browser tests use Chromium and a real compendium serve subprocess. They are not included in the default pytest run and need a one-time setup:
uv sync --extra e2e
playwright install chromium
Run the tests with:
uv run pytest -m e2e
Expect a run to take approximately 30–60 seconds. Tests are in tests/e2e/. The key test, test_csp_no_console_errors.py, visits all major pages and checks for browser console errors. It catches CSP and HTMX loading issues that unit tests may not detect.
Layout
src/compendium/
├── domain/ # models, enums, permissions, errors
├── repositories/ # base protocols + SQLAlchemy implementations
├── services/ # business logic (catalog, circulation, holds, patrons, policies, auth, audit)
├── api/ # FastAPI routes + Pydantic schemas + JWT auth
├── web/ # HTMX + Jinja2 web UI + CSRF protection
├── cli/ # Typer CLI commands
├── config/ # settings, seed data
└── db/ # engine factory, session lifecycle
Changelog
See CHANGELOG.md for a record of changes in each release.
License
MIT (to be finalised before first release).
HI-FI News
via PyPI recent updates https://pypi.org/
November 15, 2026 at 01:47AM
-
Product on sale
Audiophile Vinyl Records Cleaning BundleOriginal price was: €69.90.€59.90Current price is: €59.90. incl. VAT -
Product on sale
Easy Start Vinyl Records Cleaning KitOriginal price was: €69.90.€59.90Current price is: €59.90. incl. VAT -
Vinyl Records Cleaner Easy Groove Concentrate€34.95 incl. VAT -
Easy Groove Super Set€199.00 incl. VAT -
Easy Groove Enzycaster – vinyl records prewash cleaner€34.95 incl. VAT -
Easy Groove Extreme MK. II- vinyl records prewash cleaner€45.00 incl. VAT -
Vinyl Records Cleaner – Easy Groove Virgin Concentrate€35.00 incl. VAT -
Easy Groove Spray&Wipe vinyl records cleaner€34.95 incl. VAT








