A plug-and-play SQLite admin panel for FastAPI — beautiful, fast, and intelligent by default.
Project description
sqlite-panel
A plug-and-play SQLite admin panel for FastAPI — beautiful, fast, and intelligent by default.
Features
- One-line mount — works with any FastAPI app
- Auto-discovery — detects all tables and columns automatically
- Smart cell rendering — JSON formatting, inline image previews, boolean badges, long text expand/collapse, file & URL links
- Pagination, sorting, filtering, search — all built-in
- Inline editing — double-click any cell to edit in place
- Real-time change detection — toast notifications + auto-refresh when the DB changes
- Read-only mode — disable all writes with a single flag
- Light & dark mode — with smooth toggle and
localStoragepersistence - Keyboard shortcuts —
/to search,nfor new row,Escto close modals - SQL injection safe — all user input is parameterised or strictly validated
- Zero heavy dependencies — HTMX for partial refreshes, vanilla JS, Geist font via Google Fonts
Installation
pip install sqlite_webpanel
Quick start
from sqlite_webpanel import run_panel
run_panel(app, db_path="app.db")
# → Visit http://localhost:8888/admin
Development
git clone https://github.com/yourname/sqlite_webpanel
cd sqlite_webpanel
pip install -e ".[dev]"
pytest
Architecture
sqlite_panel/
├── __init__.py # Public API: mount_sqlite_panel
├── mount.py # FastAPI mounting + static files
├── router.py # All HTTP endpoints (web layer)
├── db.py # Core DB logic (pure Python, no web deps)
├── renderers.py # Smart cell → HTML conversion
├── static/
│ ├── panel.css # All styles (CSS variables, light/dark)
│ └── panel.js # Interactivity (vanilla JS)
└── templates/
├── base.html # Layout with sidebar
├── table.html # Table view with toolbar
├── row_detail.html
├── empty.html
├── redirect.html
└── partials/
└── rows.html # HTMX partial for table body
Key design decisions:
db.pyhas zero FastAPI/web imports — testable in isolationrenderers.pyhas zero DB imports — pure value → HTML transformation- All SQL uses parameterised queries or
_safe_identifier()validation - HTMX partial endpoints allow row refresh without full page reload
- Change detection via polling
/api/fingerprint(row count hash)
Keyboard shortcuts
| Key | Action |
|---|---|
/ |
Focus search |
n |
Open "New Row" modal |
Esc |
Close modal / cancel edit |
| Double-click cell | Inline edit |
License
MIT
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
sqlite_webpanel-0.1.4.tar.gz
(28.3 kB
view details)
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 sqlite_webpanel-0.1.4.tar.gz.
File metadata
- Download URL: sqlite_webpanel-0.1.4.tar.gz
- Upload date:
- Size: 28.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77c0f385807c3cf7ae67992974f115367add1a9b04f6c8e19420e88662f03038
|
|
| MD5 |
cf30eaf0c0596246c5237da33baf236c
|
|
| BLAKE2b-256 |
55c89124606596108a33d19167d9efc0b3698e64b08c05a2ac5098befdea6b43
|
File details
Details for the file sqlite_webpanel-0.1.4-py3-none-any.whl.
File metadata
- Download URL: sqlite_webpanel-0.1.4-py3-none-any.whl
- Upload date:
- Size: 27.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c285121e04c7f8bf486f707269b48a6d5253e6b1db2377258d45fe25f69dac53
|
|
| MD5 |
1415e1bc4bff20b2194a510135cd0c01
|
|
| BLAKE2b-256 |
a2651b8ec06a059a51f12f98dc996be30b938daa8a7f54b7c5d7c057b6a042a8
|