Skip to main content

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 / FieldConfig
  • ListFilterConfig
  • BulkActionConfig / ObjectActionConfig
  • ModelsBlock
  • HttpConfig
  • create_router(...)

Compatibility aliases are kept:

  • Admin* config names
  • create_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_list and custom search_query_builder
  • delete preview for single and bulk delete
  • RU / EN locale metadata for the frontend

Compatibility

  • FastAPI >=0.115,<1.0
  • Pydantic >=2.9,<3.0
  • SQLAlchemy >=2.0,<3.0
  • Python >=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


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.8.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xladmin-0.2.8-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file xladmin-0.2.8.tar.gz.

File metadata

  • Download URL: xladmin-0.2.8.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for xladmin-0.2.8.tar.gz
Algorithm Hash digest
SHA256 09b590763778db7873e8c896186b439ff555809908f42b8462dfd424e6756d83
MD5 fd17d16043ad5108c8e77ce6b3402754
BLAKE2b-256 badbd7a883a82b0b02f3a847e593fc6ba56885e7ebae283afd48628925a73ff7

See more details on using hashes here.

File details

Details for the file xladmin-0.2.8-py3-none-any.whl.

File metadata

  • Download URL: xladmin-0.2.8-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

Hashes for xladmin-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 aeeb1537b4fa80f66e5a48f053c526de34ce47e16d56c6707a64c5357515ed25
MD5 32851defab9ae09b6a89abc25044a227
BLAKE2b-256 98a5ea642e9e7d38c3edbf252f79e9949ff5f7eb75385e169cdc3cacc14cf39f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page