Generic FastAPI + SQLAlchemy admin backend.
Project description
xladmin backend
xladmin-backend is the backend package published to PyPI as xladmin.
Important:
- package name on PyPI:
xladmin - Python import:
from xladmin import ... - monorepo: Artasov/xladmin
Public API
AdminConfig/ModelConfig/FieldConfigListFilterConfigBulkActionConfig/ObjectActionConfigModelsBlockHttpConfigcreate_router(...)
Compatibility aliases are kept:
Admin*config namescreate_admin_router(...)
Minimal Example
from xladmin import AdminConfig, HttpConfig, ModelConfig, create_router
from src.core.auth.dependencies import get_current_user
from src.core.db.session import get_db_session
from src.modules.identity.models import UserORM
config = AdminConfig(
models=(
ModelConfig(model=UserORM),
),
)
router = create_router(
HttpConfig(
registry=config,
get_db_session_dependency=get_db_session,
get_current_user_dependency=get_current_user,
is_allowed=lambda user: bool(user.is_staff),
),
)
ModelConfig(model=UserORM) is enough for a basic admin. The library derives default slug, title, search fields, and ordering from the ORM model.
Features
- list / detail / create / patch / delete endpoints
- bulk actions and object actions
- relation choices and relation filters
- overview metadata and model blocks
query_for_listand customsearch_query_builder- delete preview for single and bulk delete
- RU / EN locale metadata for the frontend
Compatibility
FastAPI >=0.115,<1.0Pydantic >=2.9,<3.0SQLAlchemy >=2.0,<3.0Python >=3.12
Development
uv sync --extra dev
uv run pytest
uv run ruff check .
uv run mypy
uv run python -m build
uv run python -m twine check dist/*
Docs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
xladmin-0.2.7.tar.gz
(28.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
xladmin-0.2.7-py3-none-any.whl
(25.3 kB
view details)
File details
Details for the file xladmin-0.2.7.tar.gz.
File metadata
- Download URL: xladmin-0.2.7.tar.gz
- Upload date:
- Size: 28.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bc8df40050fa5ae8329f7349160c9204731ac3ea9faa06ac138a355d382b39e
|
|
| MD5 |
ddbc606500082eb21924b7e0d1b5230e
|
|
| BLAKE2b-256 |
4ff373c998d8520f32e0b5c1cf510bc24d13e08e07937ea9b443a058ca5a2e74
|
File details
Details for the file xladmin-0.2.7-py3-none-any.whl.
File metadata
- Download URL: xladmin-0.2.7-py3-none-any.whl
- Upload date:
- Size: 25.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3ed88d725cad717ab51b6219a0cdae5b120243fd2241c96f841d685b0fc1e58
|
|
| MD5 |
a8ede41c836ccf5d9c6a3d3a7c048e6e
|
|
| BLAKE2b-256 |
7b9c3f7def4b23e9bdcd2e983fdae79126649e42479cd249acd52f539c5635f2
|