Skip to main content

Admin interface for Oxyde ORM

Project description

Logo

Oxyde Admin Auto-generated admin panel for Oxyde ORM with zero boilerplate.

PyPI Downloads


Features

  • Automatic CRUD - list, create, edit, delete from your Oxyde models
  • Search & filters - text search across fields, column filters (FK, bool, string)
  • Foreign key handling - select dropdowns with inline create dialog
  • Export - CSV and JSON export with applied filters
  • Authentication - pluggable auth via callback, JWT-ready
  • Theming - 3 presets, 17 colors, 8 surface palettes
  • Bulk operations - bulk delete and update from list view
  • Multi-framework - FastAPI, Litestar, Sanic, Quart and Falcon adapters

oxyde-admin list view

Installation

pip install oxyde-admin

Quick start

from fastapi import FastAPI
from oxyde import db
from oxyde_admin import FastAPIAdmin

from models import User, Post, Comment

admin = FastAPIAdmin(title="My Admin")
admin.register(User, list_display=["name", "email"], search_fields=["name", "email"])
admin.register(Post, list_display=["title", "is_published"], list_filter=["is_published"])
admin.register(Comment)

app = FastAPI(lifespan=db.lifespan(default="sqlite:///app.db"))
app.mount("/admin", admin.app)

Open http://localhost:8000/admin/ and get a full CRUD interface for your models.

edit form

Frameworks

FastAPI

from oxyde_admin import FastAPIAdmin

admin = FastAPIAdmin(title="My Admin")
# register models...
app.mount("/admin", admin.app)

Litestar

from litestar import Litestar, asgi
from oxyde_admin import LitestarAdmin

admin = LitestarAdmin(title="My Admin")
# register models...

app = Litestar(
    route_handlers=[
        asgi(path="/admin", is_mount=True)(admin.app),
    ],
)

Sanic

from sanic import Sanic
from oxyde_admin import SanicAdmin

admin = SanicAdmin(title="My Admin")
# register models...

app = Sanic("MyApp")
admin.register_exception_handlers(app)
app.blueprint(admin.blueprint)

Quart

from quart import Quart
from oxyde_admin import QuartAdmin

admin = QuartAdmin(title="My Admin")
# register models...

app = Quart(__name__)
admin.init_app(app)

Falcon

import falcon.asgi
from oxyde_admin import FalconAdmin

admin = FalconAdmin(title="My Admin")
# register models...

app = falcon.asgi.App()
admin.init_app(app)

Model registration

admin.register(
    Post,
    list_display=["title", "author_id", "is_published", "views"],
    search_fields=["title", "content"],
    list_filter=["author_id", "is_published"],
    readonly_fields=["views"],
    ordering=["-views"],
    display_field="title",
    column_labels={"author_id": "Author", "is_published": "Published"},
    exportable=True,
    group="Content",
    icon="pi pi-file-edit",
)
Parameter Description
list_display Columns shown in the list view
search_fields Fields included in text search
list_filter Columns available as filters
readonly_fields Fields disabled in the edit form
ordering Default sort order (prefix - for descending)
display_field Field used as label in FK dropdowns
column_labels Custom column headers
exportable Enable CSV/JSON export (default: True)
group Sidebar group name
icon Sidebar icon (PrimeIcons)

You can also auto-register all models at once:

admin.register_all()

# or exclude specific models
admin.register_all(exclude={InternalModel})

Theming

from oxyde_admin import Preset, PrimaryColor, Surface

admin = FastAPIAdmin(
    title="My Admin",
    preset=Preset.AURA,
    primary_color=PrimaryColor.TEAL,
    surface=Surface.ZINC,
)

themes

Presets: AURA, LARA, NORA

Colors: NOIR EMERALD GREEN LIME ORANGE AMBER YELLOW TEAL CYAN SKY BLUE INDIGO VIOLET PURPLE FUCHSIA PINK ROSE

Surfaces: SLATE GRAY ZINC NEUTRAL STONE SOHO VIVA OCEAN

Authentication

Pass an auth_check callback and a login_url:

async def check_admin(request) -> bool:
    token = request.headers.get("Authorization", "").removeprefix("Bearer ")
    return await verify_admin_token(token)

admin = FastAPIAdmin(
    auth_check=check_admin,
    login_url="/auth/login",
)

The admin UI redirects unauthenticated users to login_url. Your login endpoint should return a JSON response with a token - the frontend stores it and sends as Authorization: Bearer <token> on every request.

License

This project is licensed under the terms of the MIT license.

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

oxyde_admin-0.3.0.tar.gz (987.6 kB view details)

Uploaded Source

Built Distribution

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

oxyde_admin-0.3.0-py3-none-any.whl (990.4 kB view details)

Uploaded Python 3

File details

Details for the file oxyde_admin-0.3.0.tar.gz.

File metadata

  • Download URL: oxyde_admin-0.3.0.tar.gz
  • Upload date:
  • Size: 987.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for oxyde_admin-0.3.0.tar.gz
Algorithm Hash digest
SHA256 caf08402f20ffd5205c7049d6a72d56d6b9c97089f7b280bcdae819dcf0e340c
MD5 94d4caa9542721ba28e5d96f2d7ddf7d
BLAKE2b-256 ca4cd807422a5211a6c730d7eb709467707afd75685ab0a89c4c0066ce5c61a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for oxyde_admin-0.3.0.tar.gz:

Publisher: release.yml on mr-fatalyst/oxyde-admin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file oxyde_admin-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: oxyde_admin-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 990.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for oxyde_admin-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5976e15a2297c52fc5f9251b1be59c1d3a7496113b4df6493f9cf3ab3287b0aa
MD5 7c0fc07b9cd9b65bb0f7862892e7cdd5
BLAKE2b-256 44f21dad6b9cbb12a48056190fc913ed7accd817a2db295b7f891f0c89147447

See more details on using hashes here.

Provenance

The following attestation bundles were made for oxyde_admin-0.3.0-py3-none-any.whl:

Publisher: release.yml on mr-fatalyst/oxyde-admin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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