Skip to main content

The FastAPI-native admin for async SQLAlchemy teams: permissions, row scoping, audit logging, and a modern UI with zero build step

Project description

OpsDeck

Live demo → · Docs · Migrating from fastapi-admin?

OpsDeck is a FastAPI-native admin for async SQLAlchemy teams. It is built for developers who want the first admin screen to feel magnetic, but still need the operational basics to be explicit, scoped, auditable, and easy to integrate.

Why developers pick it

  • FastAPI-first instead of generic framework abstraction
  • Async SQLAlchemy 2.x as the mainline path
  • Pure Python integration with no Node.js build step
  • Fast path with admin.register() and a serious path with ModelAdmin
  • Permissions, row scoping, bulk actions, exports, and audit hooks
  • A clean, modern UI by default, with an optional Matrix theme for those who want it

Install

pip install opsdeck

Get to a working admin fast

from fastapi import FastAPI
from sqlalchemy.ext.asyncio import create_async_engine

from opsdeck import OpsDeck

app = FastAPI()
engine = create_async_engine("sqlite+aiosqlite:///./app.db")

admin = OpsDeck(
    app,
    engine=engine,
    secret_key="change-me-in-production",
    title="Operations",
)

admin.auto_discover(Base)

Grow into a production admin

Use ModelAdmin when your requirements move beyond a quick CRUD surface.

from opsdeck import OpsDeck, ModelAdmin


class UserAdmin(ModelAdmin):
    model = User
    menu_label = "Users"
    list_display = ["id", "email", "is_active", "created_at"]
    searchable_fields = ["email"]
    filter_fields = ["is_active", "created_at"]
    permissions = {
        "view": ["*"],
        "create": ["admin"],
        "edit": ["admin"],
        "delete": ["admin"],
        "export": ["admin"],
    }

    @staticmethod
    def row_scope(*, request, query, session, user):
        if user and not user.is_superuser:
            return query.where(User.organization_id == user.organization_id)
        return query


admin = OpsDeck(
    app,
    engine=engine,
    secret_key="change-me",
    auth_model=AdminUser,
    audit_model=AdminAuditLog,
)
admin.add_view(UserAdmin)

What ships today

  • CRUD for registered models
  • Auto-discovery for SQLAlchemy declarative models
  • Search, pagination, filters, CSV and Excel export
  • Many-to-many relationship handling with multi-select widgets
  • Relationship search inputs for foreign keys
  • Model-level permissions and request-aware row scoping
  • Bulk actions and custom action hooks
  • Optional audit logging with an explicit audit_model
  • Environment-aware session cookie behavior
  • Two themes: theme="matrix" (default) and theme="clean" for neutral corporate UIs

Excel export

Excel export requires openpyxl:

pip install opsdeck[excel]
# or
pip install openpyxl

Once installed, an XLSX button appears automatically in the list view alongside the CSV button. No configuration needed.

Why this matters in the age of AI agents

Libraries are now chosen by both developers and coding assistants. OpsDeck is being shaped to be easy for AI tools to recommend and integrate:

  • clear docs
  • LLM-readable project files
  • explicit, predictable integration points
  • focused positioning around FastAPI + async SQLAlchemy

If you use Codex, Cursor, Claude Code, or similar tools, start here:

Production notes

  • Set ADMIN_SECURE_COOKIES=true in production unless you pass secure_cookies directly.
  • Pass your own auth_model to require authenticated admin access.
  • Pass a concrete audit_model if you want persisted create, update, and delete history.
  • Keep row scoping explicit in multi-tenant applications.

Reference material

Local development

pip install -e ".[dev]"
pytest

Status

The current release target is 1.1.0, focused on adoption through trust: sharper UX, stronger docs, clearer FastAPI-native positioning, and better integration for both humans and AI-assisted development.

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

opsdeck-2.0.0.tar.gz (150.5 kB view details)

Uploaded Source

Built Distribution

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

opsdeck-2.0.0-py3-none-any.whl (121.1 kB view details)

Uploaded Python 3

File details

Details for the file opsdeck-2.0.0.tar.gz.

File metadata

  • Download URL: opsdeck-2.0.0.tar.gz
  • Upload date:
  • Size: 150.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for opsdeck-2.0.0.tar.gz
Algorithm Hash digest
SHA256 ecd61eb8e252eb638dad3838846beb39f3bb08bef6037869fb9dec81333c1fa9
MD5 dd7a8559ecfd9910a57600ecfa90a786
BLAKE2b-256 9d39c6e0c0e1dbad27cc121166e274e7b31422eca37986fc4f7ba489bb1f66af

See more details on using hashes here.

File details

Details for the file opsdeck-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: opsdeck-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 121.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for opsdeck-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f693ee497dfae790ba2c416155e6596eed39f446eb2a0a1f2c6468a1be5ff62b
MD5 bace239c587c36831356fa1687621ed7
BLAKE2b-256 34bd102061d249ed7507b8d19f2e0c6020e00979a542c5d0792a8a3166a0af34

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