Skip to main content

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.

Metadata

Release files for opsdeck 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opsdeck 2.0.0
File Size Uploaded
opsdeck-2.0.0.tar.gz 150.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for opsdeck 2.0.0
File Interpreter ABI Platform
opsdeck-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 271.6 kB

Release files / opsdeck-2.0.0.tar.gz

Download URL opsdeck-2.0.0.tar.gz
Size 150.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ecd61eb8e252eb638dad3838846beb39f3bb08bef6037869fb9dec81333c1fa9
BLAKE2b-256 checksum
How to use checksums
9d39c6e0c0e1dbad27cc121166e274e7b31422eca37986fc4f7ba489bb1f66af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / opsdeck-2.0.0-py3-none-any.whl

Download URL opsdeck-2.0.0-py3-none-any.whl
Size 121.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f693ee497dfae790ba2c416155e6596eed39f446eb2a0a1f2c6468a1be5ff62b
BLAKE2b-256 checksum
How to use checksums
34bd102061d249ed7507b8d19f2e0c6020e00979a542c5d0792a8a3166a0af34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page