codex-fastapi-cabinet
Composable, server-rendered administration interfaces for FastAPI sites and APIs.
The library provides the management shell, routing, navigation, generic pages, dashboard widgets, permissions port, Jinja templates, and static assets. Your FastAPI application keeps ownership of authentication, authorization rules, database access, transactions, and business operations.
Status: alpha. The public API is usable, but may evolve before
1.0.
What it provides
- application-scoped admin registry;
- independent mount path, such as
/cabinetor/management; - generic list, detail, form, and operation pages;
- metric, table, list, and chart dashboard widgets;
- async application-owned data providers;
- permission checks for modules, pages, widgets, navigation, and actions;
- overridable Jinja templates and packaged responsive CSS;
- explicit module discovery without import-time registration side effects.
Installation
pip install codex-fastapi-cabinet
For local development:
uv sync --extra dev --extra docs
Quick start
from typing import ClassVar
from fastapi import FastAPI, Request
from fastapi_cabinet import (
CabinetAdmin,
CabinetProvider,
CabinetSite,
ListPage,
ListPageMap,
MetricWidget,
MetricWidgetMap,
SidebarItem,
TableColumnMap,
include_cabinet,
)
async def user_count(request: Request) -> MetricWidgetMap:
return MetricWidgetMap(
key="users-total",
title="Users",
value="42",
subtitle="Registered accounts",
)
async def user_list(request: Request) -> ListPageMap:
return ListPageMap(
title="Users",
columns=[
TableColumnMap(key="email", label="Email"),
TableColumnMap(key="status", label="Status"),
],
rows=[
{
"email": "admin@example.test",
"status": "active",
"href": "/management/users/1",
}
],
row_href_key="href",
)
class UsersAdmin(CabinetAdmin):
key = "users"
label = "Users"
sidebar = (SidebarItem(key="all", label="All users", path="all"),)
dashboard_widgets = (
MetricWidget(key="users-total", title="Users", provider="users.count"),
)
pages = (
ListPage(key="all", label="All users", path="all", provider="users.list"),
)
providers: ClassVar[dict[str, CabinetProvider]] = {
"users.count": user_count,
"users.list": user_list,
}
app = FastAPI()
site = CabinetSite(brand_name="My service")
site.register(UsersAdmin)
include_cabinet(app, site=site, mount_path="/management")
Run the complete example:
uvicorn examples.basic_app:app --reload
Then open http://127.0.0.1:8000/management.
Boundaries
codex-fastapi-cabinet is a composition toolkit, not an ORM-aware CRUD generator. Providers return
validated view models, so the same cabinet can sit over SQLAlchemy, another database layer, an HTTP
API, or an in-memory service without coupling the library to any of them.
The host application must secure the cabinet mount and provide real permission checks. The default permission provider allows every declared permission and is intended only when access control is enforced outside the library.
Documentation
- English documentation
- Русская документация
- Architecture and extension boundaries
- Template customization
- Optional offline agent skill
Development
ruff check src tests examples
mypy src tests examples
pytest
python -m build
License
Apache License 2.0. See LICENSE.
Metadata
Release files for codex-fastapi-cabinet 0.1.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 |
|---|---|---|---|---|
| codex_fastapi_cabinet-0.1.1.tar.gz | 44.3 kB | With provenance | Details for codex_fastapi_cabinet-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| codex_fastapi_cabinet-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for codex_fastapi_cabinet-0.1.1-py3-none-any.whl |
Total release size: 88.5 kB
Release files / codex_fastapi_cabinet-0.1.1.tar.gz
| Download URL | codex_fastapi_cabinet-0.1.1.tar.gz |
|---|---|
| Size | 44.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
845a048f59bc116c53efac70be8e1dc3de28565dcdc05439c6097312f73fbaa5
|
|
BLAKE2b-256 checksum How to use checksums |
dfd2df48af5d23ae1db4f0a61cde476422b097ee64a767ef49575cba2e46d4f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.
Transparency logRelease files / codex_fastapi_cabinet-0.1.1-py3-none-any.whl
| Download URL | codex_fastapi_cabinet-0.1.1-py3-none-any.whl |
|---|---|
| Size | 44.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d3eb2870d3f87e7f04b81f5e7a18f5daa2d118337abe031ef96a74743fa5f0ee
|
|
BLAKE2b-256 checksum How to use checksums |
c79949a02bf5b28ad0f9400f8aff11e0c3ace980ee93f5b4e1be29c4afc1a4d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.
Transparency logSecurity for codex-fastapi-cabinet 0.1.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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for codex_fastapi_cabinet-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.
Transparency logA 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.