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 and Sanic 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)

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.1.0.tar.gz (971.9 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.1.0-py3-none-any.whl (973.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: oxyde_admin-0.1.0.tar.gz
  • Upload date:
  • Size: 971.9 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.1.0.tar.gz
Algorithm Hash digest
SHA256 8170b04776d48bc3905285abacd5f34c198b696ab628f3ef7d6ce17b82d81a05
MD5 027e999fd81416955928e9f3c864c63b
BLAKE2b-256 34df99f13faa628305efb1bb77afa41849d67a801b77564c9adbd97f93651f8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for oxyde_admin-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: oxyde_admin-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 973.5 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65f0a17f981c8b921b90a154d06a053a89664d0520df9dabaafc70fc101e7cad
MD5 b59101131e7c706705aa650f85469927
BLAKE2b-256 9aa711a699fb77f6b806edf355ff925fc21aac89e119b5b2b7174b2d91f7937e

See more details on using hashes here.

Provenance

The following attestation bundles were made for oxyde_admin-0.1.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