drfast-api 0.1.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.
@@ -0,0 +1,98 @@
1
+ Metadata-Version: 2.5
2
+ Name: drfast-api
3
+ Version: 0.1.0
4
+ Summary: DRF-inspired async APIs for FastAPI and Tortoise ORM
5
+ Project-URL: Documentation, https://github.com/drfast-api/drfast-api#readme
6
+ Project-URL: Issues, https://github.com/drfast-api/drfast-api/issues
7
+ Project-URL: Source, https://github.com/drfast-api/drfast-api
8
+ Author: DRFast API contributors
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Classifier: Development Status :: 2 - Pre-Alpha
12
+ Classifier: Framework :: AsyncIO
13
+ Classifier: Framework :: FastAPI
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Requires-Python: >=3.11
20
+ Requires-Dist: email-validator<3,>=2.2
21
+ Requires-Dist: fastapi-users<16,>=15.0.5
22
+ Requires-Dist: fastapi<1,>=0.115
23
+ Requires-Dist: pydantic-settings<3,>=2.3
24
+ Requires-Dist: pydantic<3,>=2.7
25
+ Requires-Dist: tortoise-orm<2,>=1
26
+ Requires-Dist: uvicorn[standard]<1,>=0.30
27
+ Provides-Extra: docs
28
+ Requires-Dist: sphinx<9,>=8; extra == 'docs'
29
+ Provides-Extra: postgres
30
+ Requires-Dist: asyncpg<1,>=0.29; extra == 'postgres'
31
+ Description-Content-Type: text/markdown
32
+
33
+ # DRFast API
34
+
35
+ DRFast API brings familiar Django REST Framework patterns to fully async FastAPI applications backed by Tortoise ORM.
36
+
37
+ It is pre-1.0 software. The public surface includes serializers, model viewsets, routers, permissions, middleware, settings, Tortoise lifecycle integration, FastAPI Users integration, and the `drfast` management CLI.
38
+
39
+ ## Quick start
40
+
41
+ ```bash
42
+ uv add drfast-api
43
+ drfast startproject config
44
+ cd config
45
+ drfast migrate
46
+ drfast runserver
47
+ ```
48
+
49
+ Generated projects use SQLite locally. Set `DATABASE_URL` to a PostgreSQL URL and install `drfast-api[postgres]` for production.
50
+
51
+ ## Application structure
52
+
53
+ Projects explicitly list Tortoise model modules in `Settings.installed_apps`. A generated app keeps models, serializers, and views separate:
54
+
55
+ ```python
56
+ class TodoSerializer(ModelSerializer[Todo]):
57
+ model = Todo
58
+ id = UUIDField(read_only=True)
59
+ title = CharField()
60
+
61
+
62
+ class TodoViewSet(ModelViewSet):
63
+ model = Todo
64
+ serializer_class = TodoSerializer
65
+ ordering_fields = ("created_at", "title")
66
+ ```
67
+
68
+ Register it with `DefaultRouter`, then include the router in the FastAPI application. Viewset handlers, serializer hooks, permission methods, and middleware hooks are asynchronous.
69
+
70
+ `drfast` delegates migration operations to Tortoise’s current built-in migration CLI:
71
+
72
+ ```bash
73
+ drfast init
74
+ drfast makemigrations --name add_todos
75
+ drfast migrate
76
+ drfast history
77
+ ```
78
+
79
+ The starter’s authentication uses FastAPI Users with DRFast’s Tortoise adapter. It enables registration and bearer JWT login; password reset and email verification require application-provided delivery hooks before they are enabled.
80
+
81
+ ## Configuration
82
+
83
+ Copy `.env.example` to `.env` in generated projects. `SECRET_KEY` must be changed and `DEBUG=false` set for production. SQLite is suitable for local development and isolated tests; production should use PostgreSQL, explicit migrations, and an `asyncpg` connection URL.
84
+
85
+ ## Development
86
+
87
+ ```bash
88
+ uv sync
89
+ uv run ruff check .
90
+ uv run mypy src
91
+ uv run pytest
92
+ uv run bandit -q -r src
93
+ uv run pip-audit --skip-editable
94
+ uv run python -m build
95
+ ```
96
+
97
+ The CI workflow also runs Bandit and pip-audit. Configure the PyPI trusted publisher for the `pypi` GitHub environment before tagging a release.
98
+
@@ -0,0 +1,18 @@
1
+ drfast/__init__.py,sha256=7O0_jEklOaRW5Tm83dj_JgNbCnUE98JMq_rtq8MLLgc,986
2
+ drfast/auth.py,sha256=TUfhQE5HJMt-5VsLy676kguHhyBqIh_n2iTQ-ZaghDU,4232
3
+ drfast/cli.py,sha256=xZoa8x-p7ziwQCbr5efWnUPQ6TeV7nIR3hzZuORZhRw,10031
4
+ drfast/filters.py,sha256=DLimUZfr0Xi47tpaDHvtGtNNQHE9HeSTIsa-I3B6LS4,1079
5
+ drfast/middleware.py,sha256=aVt2WmQCBGhf66UMfkVqoh7b2OCIQlCUrR-bOE54KIs,1550
6
+ drfast/models.py,sha256=3fKDfA7D1m5xIWYOI_ub53yjDj8LsYx65hRHdd7dbmA,1007
7
+ drfast/orm.py,sha256=OeY4ZmJnEfMoT5nI00NhQIMM0WrxlMItLT3j-RH9614,992
8
+ drfast/pagination.py,sha256=fPy6EJhTvx8ABqkkD6i0DMmre1c_e5XlXPpIFAbvFKE,1347
9
+ drfast/permissions.py,sha256=z7L3SfO0JFSw4y_7H5JFZ3mYvarn7zSN9pBtIS3ggmM,1668
10
+ drfast/routers.py,sha256=qugeP9Dz4nWwamAeoppnVAFqBLr3dDjYiCjTHqtxUSc,1051
11
+ drfast/serializers.py,sha256=qMKP2YtWLXltWm8HjZl5Kq_BtJCpShwpWD2ZdV3cv4Y,6663
12
+ drfast/settings.py,sha256=mvbBoKFYi3ajRi_R0bufKmjDckL4M8VBWln6BPc_yZI,1525
13
+ drfast/views.py,sha256=ri0MmxyZaPmEtefNFMklh0mtnmj9cSW9tQDDvvW0PPs,7528
14
+ drfast_api-0.1.0.dist-info/METADATA,sha256=F1VVga6A-zvaFc4R_08TJEqUeowgAaA2eTBieYZEHoI,3458
15
+ drfast_api-0.1.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
16
+ drfast_api-0.1.0.dist-info/entry_points.txt,sha256=sec3-ioEUxIliXT5ieg1GPPPx-6_rFu2rdC7HbgrKBM,43
17
+ drfast_api-0.1.0.dist-info/licenses/LICENSE,sha256=KxC3m3tg5VegnAc95Ia8Il-8s6fcS15-Yc8uR1vsZrw,1080
18
+ drfast_api-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.4
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ drfast = drfast.cli:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DRFast API contributors
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.