fastapi-sqlite-ui 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fastapi_sqlite_ui/__init__.py +16 -0
- fastapi_sqlite_ui/driver.py +174 -0
- fastapi_sqlite_ui/router.py +120 -0
- fastapi_sqlite_ui/ui.py +1131 -0
- fastapi_sqlite_ui-1.0.0.dist-info/METADATA +106 -0
- fastapi_sqlite_ui-1.0.0.dist-info/RECORD +8 -0
- fastapi_sqlite_ui-1.0.0.dist-info/WHEEL +4 -0
- fastapi_sqlite_ui-1.0.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fastapi-sqlite-ui
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A lightweight, plug-and-play SQLite administration panel UI for FastAPI.
|
|
5
|
+
Author: hoangtuvungcao
|
|
6
|
+
License: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Classifier: Framework :: FastAPI
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Requires-Python: >=3.8
|
|
13
|
+
Requires-Dist: fastapi>=0.100.0
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# fastapi-sqlite-ui
|
|
17
|
+
|
|
18
|
+
A lightweight, plug-and-play SQLite administration panel UI for FastAPI applications.
|
|
19
|
+
|
|
20
|
+
*Giao diện quản lý SQLite Admin Panel gọn nhẹ, cắm-là-chạy dành cho các ứng dụng FastAPI.*
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Design & Layout (Thiết kế & Bố cục)
|
|
25
|
+
|
|
26
|
+
### English
|
|
27
|
+
The user interface utilizes standard modern design practices:
|
|
28
|
+
- **Dark Theme**: High-contrast dark mode (`#0b0f19`) featuring subtle borders and glassmorphism.
|
|
29
|
+
- **Icons & Typography**: Uses Google Font *Inter* for readability and *Lucide Icons* for user interface control mapping.
|
|
30
|
+
- **Transitions**: Smooth micro-interactions for modal triggers and status notifications.
|
|
31
|
+
|
|
32
|
+
### Tiếng Việt
|
|
33
|
+
Giao diện người dùng sử dụng các nguyên lý thiết kế hiện đại:
|
|
34
|
+
- **Chủ đề tối (Dark Theme)**: Chế độ tối độ tương phản cao (`#0b0f19`) kết hợp đường viền mỏng và hiệu ứng mờ kính (glassmorphism).
|
|
35
|
+
- **Biểu tượng & Font chữ**: Sử dụng font chữ *Inter* để tối ưu khả năng đọc và *Lucide Icons* để mô tả điều hướng trực quan.
|
|
36
|
+
- **Hiệu ứng chuyển động**: Các tương tác nhỏ (micro-interactions) mượt mà cho các sự kiện mở modal và thông báo trạng thái.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Features (Tính năng)
|
|
41
|
+
|
|
42
|
+
### English
|
|
43
|
+
- **Plug & Play**: Single function call to mount the APIRouter.
|
|
44
|
+
- **Data Browser**: Paginated table view with search filters on text columns.
|
|
45
|
+
- **Schema Inspector**: Structured view of columns, data types, primary keys, and foreign keys.
|
|
46
|
+
- **Full CRUD**: Complete row insert, update, and delete support with schema-aware input fields.
|
|
47
|
+
- **Raw SQL Console**: Text-area input for executing arbitrary raw SQL statements with elapsed time metrics.
|
|
48
|
+
- **Read-Only Mode**: Toggle option to restrict database modifications.
|
|
49
|
+
- **Self-contained SPA**: No asset build steps required by the parent Python server.
|
|
50
|
+
|
|
51
|
+
### Tiếng Việt
|
|
52
|
+
- **Tích hợp nhanh**: Chỉ cần gọi một hàm để gắn APIRouter vào ứng dụng.
|
|
53
|
+
- **Duyệt dữ liệu**: Hiển thị bảng dạng phân trang kèm bộ lọc tìm kiếm trên các cột văn bản.
|
|
54
|
+
- **Kiểm tra cấu trúc**: Xem cấu trúc cột, kiểu dữ liệu, khóa chính và khóa ngoại.
|
|
55
|
+
- **Hỗ trợ CRUD**: Thao tác thêm, sửa, xóa các dòng dữ liệu thông qua các biểu mẫu tự động tương thích theo cấu trúc bảng.
|
|
56
|
+
- **Trình chạy SQL Raw**: Nhập và thực thi trực tiếp các câu lệnh SQL tự do có đo lường thời gian phản hồi.
|
|
57
|
+
- **Chế độ chỉ đọc (Read-Only)**: Cấu hình tùy chọn để chặn các thao tác ghi dữ liệu.
|
|
58
|
+
- **SPA tự đóng gói**: Không yêu cầu bước biên dịch tài nguyên tĩnh từ phía server Python.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Installation (Cài đặt)
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install fastapi-sqlite-ui
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Make sure you have `fastapi` and `uvicorn` installed.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Usage (Cách dùng)
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
from fastapi import FastAPI
|
|
76
|
+
from fastapi_sqlite_ui import mount_sqlite_ui
|
|
77
|
+
|
|
78
|
+
app = FastAPI()
|
|
79
|
+
|
|
80
|
+
# Mount the SQLite UI at /admin
|
|
81
|
+
mount_sqlite_ui(
|
|
82
|
+
app,
|
|
83
|
+
db_path="./mydb.sqlite",
|
|
84
|
+
mount_path="/admin",
|
|
85
|
+
read_only=False
|
|
86
|
+
)
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Options (Cấu hình)
|
|
92
|
+
|
|
93
|
+
The `mount_sqlite_ui` function takes the following parameters:
|
|
94
|
+
|
|
95
|
+
| Parameter | Type | Default | Description / Mô tả |
|
|
96
|
+
| :--- | :--- | :--- | :--- |
|
|
97
|
+
| `app` | `FastAPI` | *Required* | The FastAPI application instance. / *Đối tượng ứng dụng FastAPI.* |
|
|
98
|
+
| `db_path` | `str` | *Required* | Path to the SQLite database file. / *Đường dẫn đến tệp cơ sở dữ liệu SQLite.* |
|
|
99
|
+
| `mount_path` | `str` | `"/admin"` | URL prefix for the administration dashboard. / *Tiền tố đường dẫn URL cho trang quản trị.* |
|
|
100
|
+
| `read_only` | `bool` | `False` | Hides CRUD actions and blocks write queries if True. / *Nếu là True, ẩn giao diện CRUD và chặn các câu lệnh ghi dữ liệu.* |
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## License
|
|
105
|
+
|
|
106
|
+
MIT License.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
fastapi_sqlite_ui/__init__.py,sha256=M3HN_0svl5udFwOT50PiAhqvjRrRAxYfMhvkxV1brr4,672
|
|
2
|
+
fastapi_sqlite_ui/driver.py,sha256=XDxM6uwFCHWyOngo7oUwzbEjckOnx6eq4c2IuFVtdmk,6420
|
|
3
|
+
fastapi_sqlite_ui/router.py,sha256=ZxgXyAr4AigIw35jLUHi4UfRo8YujEdZ4QPSf6vMQfk,4853
|
|
4
|
+
fastapi_sqlite_ui/ui.py,sha256=P0cgMqWRuh35Bz2jxxepDm-3_RhOQ4Ew_FZ1p3C4Y18,49493
|
|
5
|
+
fastapi_sqlite_ui-1.0.0.dist-info/METADATA,sha256=_kjj_dRNIIWstbomW2oeruxp1L9ai-lVrsGnkZSAR6s,4427
|
|
6
|
+
fastapi_sqlite_ui-1.0.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
7
|
+
fastapi_sqlite_ui-1.0.0.dist-info/licenses/LICENSE,sha256=XkRBOvYJK6RFIRblZujoCEgQZqJ7fEMLFsWBGsDaJ1U,1071
|
|
8
|
+
fastapi_sqlite_ui-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 hoangtuvungcao
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|