Admin interface for Oxyde ORM
Project description
Oxyde Admin Auto-generated admin panel for Oxyde ORM with zero boilerplate.
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
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.
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,
)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8170b04776d48bc3905285abacd5f34c198b696ab628f3ef7d6ce17b82d81a05
|
|
| MD5 |
027e999fd81416955928e9f3c864c63b
|
|
| BLAKE2b-256 |
34df99f13faa628305efb1bb77afa41849d67a801b77564c9adbd97f93651f8f
|
Provenance
The following attestation bundles were made for oxyde_admin-0.1.0.tar.gz:
Publisher:
release.yml on mr-fatalyst/oxyde-admin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oxyde_admin-0.1.0.tar.gz -
Subject digest:
8170b04776d48bc3905285abacd5f34c198b696ab628f3ef7d6ce17b82d81a05 - Sigstore transparency entry: 1004371874
- Sigstore integration time:
-
Permalink:
mr-fatalyst/oxyde-admin@345a5e4880726e881665434f71d4bfa3c98f03cb -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mr-fatalyst
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@345a5e4880726e881665434f71d4bfa3c98f03cb -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65f0a17f981c8b921b90a154d06a053a89664d0520df9dabaafc70fc101e7cad
|
|
| MD5 |
b59101131e7c706705aa650f85469927
|
|
| BLAKE2b-256 |
9aa711a699fb77f6b806edf355ff925fc21aac89e119b5b2b7174b2d91f7937e
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oxyde_admin-0.1.0-py3-none-any.whl -
Subject digest:
65f0a17f981c8b921b90a154d06a053a89664d0520df9dabaafc70fc101e7cad - Sigstore transparency entry: 1004371885
- Sigstore integration time:
-
Permalink:
mr-fatalyst/oxyde-admin@345a5e4880726e881665434f71d4bfa3c98f03cb -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mr-fatalyst
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@345a5e4880726e881665434f71d4bfa3c98f03cb -
Trigger Event:
push
-
Statement type: