brilliance-admin 0.39.0__py3-none-any.whl → 0.41.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.
@@ -13,8 +13,8 @@
13
13
  <link rel="icon" href="{{ favicon_image }}" />
14
14
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
15
15
  <title>{{ title }}</title>
16
- <script type="module" crossorigin src="/admin/static/index-SCeDXvci.js"></script>
17
- <link rel="stylesheet" crossorigin href="/admin/static/index-BrXRRuaE.css">
16
+ <script type="module" crossorigin src="/admin/static/index-BeniOHDv.js"></script>
17
+ <link rel="stylesheet" crossorigin href="/admin/static/index-vlBToOhT.css">
18
18
  </head>
19
19
 
20
20
  <body>
@@ -0,0 +1,155 @@
1
+ Metadata-Version: 2.4
2
+ Name: brilliance-admin
3
+ Version: 0.41.0
4
+ Summary: General-purpose admin panel framework powered by FastAPI. Some call it heavenly in its brilliance.
5
+ License-Expression: AGPL-3.0
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: asgiref>=3.11.0
10
+ Requires-Dist: fastapi>=0.115.8
11
+ Requires-Dist: jinja2>=3.1.6
12
+ Provides-Extra: example
13
+ Requires-Dist: uvicorn>=0.34.0; extra == "example"
14
+ Requires-Dist: faker>=38.2.0; extra == "example"
15
+ Requires-Dist: pyjwt>=2.10.1; extra == "example"
16
+ Requires-Dist: structlog>=25.5.0; extra == "example"
17
+ Requires-Dist: rich>=14.2.0; extra == "example"
18
+ Provides-Extra: tests
19
+ Requires-Dist: pytest>=8.4.2; extra == "tests"
20
+ Requires-Dist: pytest-asyncio>=1.2.0; extra == "tests"
21
+ Requires-Dist: httpx>=0.28.1; extra == "tests"
22
+ Requires-Dist: pytest-mock>=3.15.1; extra == "tests"
23
+ Requires-Dist: sqlalchemy>=2.0.41; extra == "tests"
24
+ Requires-Dist: aiosqlite>=0.22.1; extra == "tests"
25
+ Requires-Dist: factory-boy>=3.3.3; extra == "tests"
26
+ Requires-Dist: pyjwt>=2.10.1; extra == "tests"
27
+ Provides-Extra: scalar
28
+ Requires-Dist: scalar-fastapi>=1.5.0; extra == "scalar"
29
+ Dynamic: license-file
30
+
31
+ <div align="center">
32
+ <img src="https://github.com/brilliance-admin/backend-python/blob/main/example/static/logo.png?raw=true"
33
+ alt="Brilliance Admin"
34
+ width="600">
35
+ </div>
36
+
37
+ <div align="center">
38
+
39
+ [![PyPI](https://img.shields.io/pypi/v/brilliance-admin)](https://pypi.org/project/brilliance-admin/)
40
+ [![License](https://img.shields.io/pypi/l/brilliance-admin)](https://github.com/brilliance-admin/backend-python/blob/main/LICENSE)
41
+ [![CI](https://github.com/brilliance-admin/backend-python/actions/workflows/deploy.yml/badge.svg)](https://github.com/brilliance-admin/backend-python/actions)
42
+
43
+ </div>
44
+
45
+ General-purpose admin panel framework powered by FastAPI. Some call it heavenly in its brilliance.
46
+
47
+ - Serves a prebuilt SPA frontend as static files
48
+ - Generates schemas for frontend sections on the backend
49
+ - Provides a backend-driven API for admin interfaces
50
+ - Designed for fast data management and data viewing from any sources
51
+ - Inspired by Django Admin and Django REST Framework
52
+ - Focused on minimal boilerplate and simplified backend-controlled configuration
53
+
54
+ ### [Live Demo](https://brilliance-admin.com/) | [Example App](https://github.com/brilliance-admin/backend-python/tree/main/example) | Documentation (todo)
55
+
56
+
57
+ ### Features:
58
+
59
+ * Tables with full CRUD support, including filtering, sorting, and pagination.
60
+ * Ability to define custom table actions with forms, response messages, and file uploads.
61
+ * SQLAlchemy integration with automatic field generation from models.
62
+ * Authorization via any account data source.
63
+ * Localization support with language selection in the interface.
64
+
65
+ ## How to use it
66
+
67
+ Installation:
68
+ ``` shell
69
+ pip install brilliance-admin
70
+ ```
71
+
72
+ You need to generate `AdminSchema` instance:
73
+ ``` python
74
+ from admin_panel import schema
75
+
76
+ admin_schema = schema.AdminSchema(
77
+ title='Admin Panel',
78
+ auth=YourAdminAuthentication(),
79
+ groups=[
80
+ schema.Group(
81
+ slug='example',
82
+ title='Example',
83
+ icon='mdi-star',
84
+ categories=[
85
+ CategoryExample(),
86
+ ]
87
+ ),
88
+ ],
89
+ )
90
+
91
+ admin_app = admin_schema.generate_app()
92
+
93
+ # Your FastAPI app
94
+ app = FastAPI()
95
+ app.mount('/admin', admin_app)
96
+ ```
97
+
98
+ ### SQLAlchemy integration
99
+ Brilliance Admin supports automatic schema generation from SQLAlchemy and provides a ready-made CRUD implementation for tables.
100
+
101
+ ``` python
102
+ from admin_panel import sqlalchemy
103
+ from admin_panel.translations import TranslateText as _
104
+
105
+ from your_project.models import Terminal
106
+
107
+
108
+ class TerminalAdmin(sqlalchemy.SQLAlchemyAdmin):
109
+ db_async_session = async_sessionmaker
110
+ model = Terminal
111
+ title = _('terminals')
112
+ icon = 'mdi-console-network-outline'
113
+
114
+ ordering_fields = ['id']
115
+ search_fields = ['id', 'title']
116
+
117
+ table_schema = sqlalchemy.SQLAlchemyFieldsSchema(
118
+ model=Terminal,
119
+ list_display=['id', 'merchant_id'],
120
+ )
121
+ table_filters = sqlalchemy.SQLAlchemyFieldsSchema(
122
+ model=Terminal,
123
+ fields=['id', 'created_at'],
124
+ created_at=schema.DateTimeField(range=True),
125
+ )
126
+
127
+
128
+ category = TerminalAdmin()
129
+ ```
130
+
131
+ Now, the `TerminalAdmin` instance can be passed to `categories`.
132
+
133
+ ### Can be used both via inheritance and instancing
134
+
135
+ For `SQLAlchemyFieldsSchema`
136
+
137
+ ``` python
138
+ class TerminalTableSchema(sqlalchemy.SQLAlchemyFieldsSchema):
139
+ model = Terminal
140
+ fields = ['id', 'created_at']
141
+
142
+ created_at=schema.DateTimeField(range=True)
143
+
144
+
145
+ class TerminalAdmin(sqlalchemy.SQLAlchemyAdmin):
146
+ table_schema = TerminalTableSchema()
147
+ ```
148
+
149
+ And `SQLAlchemyAdmin` category schema itself
150
+
151
+ > If `table_schema` is not specified, it will be generated automatically and will include all discovered fields and relationships of the table in the output.
152
+
153
+ ``` python
154
+ category = sqlalchemy.SQLAlchemyAdmin(db_async_session=async_sessionmaker, model=Terminal)
155
+ ```
@@ -29,7 +29,7 @@ admin_panel/integrations/sqlalchemy/table/list.py,sha256=80wl9Ja1_Dc6p_6zTi-trxg
29
29
  admin_panel/integrations/sqlalchemy/table/retrieve.py,sha256=kuHyMGvJhTlWyHuB1wXNl6HelAkMzQjhcMGZwOHtSK0,2115
30
30
  admin_panel/integrations/sqlalchemy/table/update.py,sha256=O1hpzEP04tUv_HUD8ChCBqYbjjnrRc2houvJbNUYEzY,3518
31
31
  admin_panel/schema/__init__.py,sha256=X-izShvv84jkFU47WfpUwtvRh3NOv570iUB3NRNEIDU,248
32
- admin_panel/schema/admin_schema.py,sha256=wTTdNcpFgPDOU3402lW4a-dSlhW723KhXrVURfbEw6o,6041
32
+ admin_panel/schema/admin_schema.py,sha256=_bQmDTnBzq_uxEAgQ-Dqra5rTewtaLY_HboB3__n80o,6224
33
33
  admin_panel/schema/category.py,sha256=ph7rndUK21lxRDToYpcYnvIyfGwPP-HESST7DxObdqU,4108
34
34
  admin_panel/schema/group.py,sha256=h4AuiGEsy3yE1Oz5YlJ6lOhDEzIgi4WgtmLZ4JRgrgg,2238
35
35
  admin_panel/schema/graphs/__init__.py,sha256=qvmZv9QWdiutPtN5VYQLYbsjY2SOg8p_XRaz2rUlIxY,44
@@ -42,9 +42,9 @@ admin_panel/schema/table/table_models.py,sha256=7UQyqZcA-2sz0731EAkvhPKDuZbxCqUT
42
42
  admin_panel/schema/table/fields/__init__.py,sha256=RW-sIFTAaSQo4mMR6iWtnefogWPjmg6KAsDwe9mKW1k,291
43
43
  admin_panel/schema/table/fields/base.py,sha256=Po4M04oF4OuPFqYRH28SlIpH8C3BEBlGuaR_K6MdFRs,7789
44
44
  admin_panel/schema/table/fields/function_field.py,sha256=MlPCHtc10-WWcnZ0jX7rGoTr6mG1HhloAKW_cB69GAI,1765
45
- admin_panel/static/favicon.ico,sha256=uILLbjeNIHux49hAdgXM_1d3eYa-01CND6WsJhBVPWY,2238
46
- admin_panel/static/index-BrXRRuaE.css,sha256=nnsP5KuP7qUyssa2UoS6y6KuYAqi0FD3dGyJYQPiqXg,982861
47
- admin_panel/static/index-SCeDXvci.js,sha256=TGiH1tesNcyho3VE_KNDkJR1KK-ZKZiDxjJg9vYzbes,3201763
45
+ admin_panel/static/favicon.jpg,sha256=_np-jvdgK1qgkqbbz9yecZ-PoR4iMwltHthQ2gYebYk,12991
46
+ admin_panel/static/index-BeniOHDv.js,sha256=U5N_dXe2QOlSKVVwJ0Ghu8hNIiBD9QF-bK_04MAgucc,3201882
47
+ admin_panel/static/index-vlBToOhT.css,sha256=hoVCpcStTHdAVRm37k1umrNdXjOwIIveu9lxk4ocpEc,983028
48
48
  admin_panel/static/materialdesignicons-webfont-CYDMK1kx.woff2,sha256=5S1g9kJnzaoIQitQurXUW9NeZisDua91F5zq4ArF_Is,385360
49
49
  admin_panel/static/materialdesignicons-webfont-CgCzGbLl.woff,sha256=SNPuxqtw3HoZCPm6LyCOClhxi57hbj9qvbXbT0Yfolg,561776
50
50
  admin_panel/static/materialdesignicons-webfont-D3kAzl71.ttf,sha256=vXJaejiTnltZkE4benJlkZ7OwlYWbs5p1RXCEAUWWQc,1243500
@@ -65,9 +65,9 @@ admin_panel/static/tinymce/plugins/accordion/css/accordion.css,sha256=u5UQkMNA9f
65
65
  admin_panel/static/tinymce/plugins/codesample/css/prism.css,sha256=exAdMtHbvwW7-DEs567MX65Fq1aJQTfREP5pw8gW-AY,1736
66
66
  admin_panel/static/tinymce/plugins/customLink/plugin.js,sha256=illBNpnHDkBsLG6wo_jDPF6z7CGnO1MQWUoDwZKy6vQ,5589
67
67
  admin_panel/static/tinymce/plugins/customLink/css/link.css,sha256=gh5nvY8Z92hJfCEBPnIm4jIPCcKKbJnab-30oIfX7Hc,56
68
- admin_panel/templates/index.html,sha256=wGTSCQQ0H4QnWaYOnXb98g0x1UmlHjzksaO9Jom643E,1294
69
- brilliance_admin-0.39.0.dist-info/licenses/LICENSE,sha256=PjeDRXGbVLtKul5Xpfco_6CyB6bYGWVVPrO0oubquuM,727
70
- brilliance_admin-0.39.0.dist-info/METADATA,sha256=CJfMKaHUnmJvDA7Tbpe3m9hwjFXGDHd-zfnm-j5Cj9k,2451
71
- brilliance_admin-0.39.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
72
- brilliance_admin-0.39.0.dist-info/top_level.txt,sha256=saSuhWhjU9d5_tZnnBG6GYVQY7ywThehjbEePImWik8,12
73
- brilliance_admin-0.39.0.dist-info/RECORD,,
68
+ admin_panel/templates/index.html,sha256=7a3DWqQxaHhm0_NfPmae5D55rRKPkrZx8fmsvDaxy8Y,1294
69
+ brilliance_admin-0.41.0.dist-info/licenses/LICENSE,sha256=PjeDRXGbVLtKul5Xpfco_6CyB6bYGWVVPrO0oubquuM,727
70
+ brilliance_admin-0.41.0.dist-info/METADATA,sha256=61T8pSttSvFoWFxZ6IY0TKQQ4dkl5zVVT-Rt1xA3UEM,4988
71
+ brilliance_admin-0.41.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
72
+ brilliance_admin-0.41.0.dist-info/top_level.txt,sha256=saSuhWhjU9d5_tZnnBG6GYVQY7ywThehjbEePImWik8,12
73
+ brilliance_admin-0.41.0.dist-info/RECORD,,
Binary file
@@ -1,76 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: brilliance-admin
3
- Version: 0.39.0
4
- Summary: General-purpose admin panel backend
5
- License-Expression: AGPL-3.0
6
- Requires-Python: >=3.10
7
- Description-Content-Type: text/markdown
8
- License-File: LICENSE
9
- Requires-Dist: asgiref>=3.11.0
10
- Requires-Dist: fastapi>=0.115.8
11
- Requires-Dist: jinja2>=3.1.6
12
- Provides-Extra: example
13
- Requires-Dist: uvicorn>=0.34.0; extra == "example"
14
- Requires-Dist: faker>=38.2.0; extra == "example"
15
- Requires-Dist: pyjwt>=2.10.1; extra == "example"
16
- Requires-Dist: structlog>=25.5.0; extra == "example"
17
- Requires-Dist: rich>=14.2.0; extra == "example"
18
- Provides-Extra: tests
19
- Requires-Dist: pytest>=8.4.2; extra == "tests"
20
- Requires-Dist: pytest-asyncio>=1.2.0; extra == "tests"
21
- Requires-Dist: httpx>=0.28.1; extra == "tests"
22
- Requires-Dist: pytest-mock>=3.15.1; extra == "tests"
23
- Requires-Dist: sqlalchemy>=2.0.41; extra == "tests"
24
- Requires-Dist: aiosqlite>=0.22.1; extra == "tests"
25
- Requires-Dist: factory-boy>=3.3.3; extra == "tests"
26
- Requires-Dist: pyjwt>=2.10.1; extra == "tests"
27
- Provides-Extra: scalar
28
- Requires-Dist: scalar-fastapi>=1.5.0; extra == "scalar"
29
- Dynamic: license-file
30
-
31
- # Brilliance Admin Backend
32
-
33
- Brilliance Admin Backend is a backend framework for building admin panels with Python and FastAPI.
34
-
35
- - Serves a prebuilt SPA frontend as static files
36
- - Generates schemas for frontend sections on the backend
37
- - Provides a backend-driven API for admin interfaces
38
- - Designed for fast data management and data viewing from any sources
39
- - Inspired by Django Admin and Django REST Framework
40
- - Focused on minimal boilerplate and simplified backend-controlled configuration
41
-
42
- Features:
43
- -
44
- [Live Demo](https://brilliance-admin.com/)
45
-
46
-
47
- ## Development
48
-
49
- ``` shell
50
- uv sync --all-groups --all-extras
51
- uv run uvicorn example.main:app --host 0.0.0.0 --port 8082 --reload
52
- ```
53
-
54
- Docs:
55
- - `http://0.0.0.0:8082/docs`
56
- - `http://0.0.0.0:8082/redoc`
57
- - `http://0.0.0.0:8082/scalar`
58
-
59
- Tests:
60
- ``` shell
61
- uv run pytest
62
- ```
63
-
64
- ## Docker
65
-
66
- ``` shell
67
- docker compose -f .configs/docker/docker-compose.yml build
68
- docker compose -f .configs/docker/docker-compose.yml up
69
- docker compose -f .configs/docker/docker-compose.yml run --rm backend /bin/bash -c "uv sync --all-groups --all-extras"
70
- docker compose -f .configs/docker/docker-compose.yml run --rm backend /bin/bash -c "uv run pytest"
71
- ```
72
-
73
- ``` shell
74
- docker exec -it rollyum-backend-1 git config --global --add safe.directory '*'
75
- docker exec -it rollyum-backend-1 uv run pre-commit run --all-files
76
- ```