python-flashapi 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,259 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-flashapi
3
+ Version: 0.1.0
4
+ Summary: Define your models. FlashAPI does the rest.
5
+ Project-URL: Homepage, https://github.com/flashapi/flashapi
6
+ Project-URL: Documentation, https://flashapi.dev
7
+ Project-URL: Repository, https://github.com/flashapi/flashapi
8
+ Author: FlashAPI Contributors
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: api,automatic,crud,django,fastapi,flask,rest
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.10
22
+ Provides-Extra: all
23
+ Requires-Dist: django>=4.2; extra == 'all'
24
+ Requires-Dist: fastapi>=0.100.0; extra == 'all'
25
+ Requires-Dist: flask>=2.3.0; extra == 'all'
26
+ Requires-Dist: uvicorn>=0.20.0; extra == 'all'
27
+ Provides-Extra: dev
28
+ Requires-Dist: httpx; extra == 'dev'
29
+ Requires-Dist: pytest-asyncio; extra == 'dev'
30
+ Requires-Dist: pytest>=7.0; extra == 'dev'
31
+ Requires-Dist: ruff; extra == 'dev'
32
+ Provides-Extra: django
33
+ Requires-Dist: django>=4.2; extra == 'django'
34
+ Provides-Extra: fastapi
35
+ Requires-Dist: fastapi>=0.100.0; extra == 'fastapi'
36
+ Requires-Dist: pydantic>=2.0; extra == 'fastapi'
37
+ Requires-Dist: uvicorn>=0.20.0; extra == 'fastapi'
38
+ Provides-Extra: flask
39
+ Requires-Dist: flask>=2.3.0; extra == 'flask'
40
+ Description-Content-Type: text/markdown
41
+
42
+ <p align="center">
43
+ <img src="docs/logo.svg" alt="FlashAPI" width="400">
44
+ </p>
45
+
46
+ <p align="center">
47
+ <strong>Define your models. FlashAPI does the rest.</strong>
48
+ </p>
49
+
50
+ <p align="center">
51
+ <a href="https://pypi.org/project/flashapi/"><img src="https://img.shields.io/pypi/v/flashapi?color=blue" alt="PyPI version"></a>
52
+ <a href="https://github.com/flashapi/flashapi/actions/workflows/ci.yml"><img src="https://github.com/flashapi/flashapi/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
53
+ <a href="https://pypi.org/project/flashapi/"><img src="https://img.shields.io/pypi/pyversions/flashapi" alt="Python versions"></a>
54
+ <a href="https://github.com/flashapi/flashapi/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="License"></a>
55
+ </p>
56
+
57
+ <p align="center">
58
+ <a href="#installation">Installation</a> &bull;
59
+ <a href="#quick-start">Quick Start</a> &bull;
60
+ <a href="docs/integration.md">Docs</a> &bull;
61
+ <a href="CHANGELOG.md">Changelog</a>
62
+ </p>
63
+
64
+ ---
65
+
66
+ FlashAPI generates a full REST API with CRUD, pagination, filtering, sorting, full-text search, relations, and interactive documentation from your existing models — in one line.
67
+
68
+ ---
69
+
70
+ ## Documentation
71
+
72
+ | Doc | Description |
73
+ |-----|-------------|
74
+ | **[Integration Guide](docs/integration.md)** | Where to put FlashAPI in your project, new vs existing project, all 3 frameworks |
75
+ | **[Features](docs/features.md)** | CRUD, pagination, filtering, sorting, search — detailed usage |
76
+ | **[Relations](docs/relations.md)** | Nested routes, expand, how relations are detected |
77
+ | **[Customization](docs/customization.md)** | Model wrapper, readonly, exclude, only, plural, response format, database |
78
+ | **[Authentication](docs/authentication.md)** | How to protect endpoints (Django middleware, FastAPI deps, Flask before_request) |
79
+ | **[Custom Logic](docs/custom-logic.md)** | How FlashAPI coexists with your business logic, when to use what |
80
+ | **[Framework Notes](docs/framework-notes.md)** | Django, FastAPI, Flask specifics (serialization, URLs, field behavior) |
81
+ | **[Full Examples](docs/examples.md)** | E-commerce, school, restaurant, blog, SaaS, minimal todo |
82
+
83
+ ---
84
+
85
+ ## Installation
86
+
87
+ ```bash
88
+ pip install flashapi[fastapi] # or flashapi[django] or flashapi[flask] or flashapi[all]
89
+ ```
90
+
91
+ ---
92
+
93
+ ## Quick Start
94
+
95
+ ### FastAPI (new project)
96
+
97
+ ```python
98
+ # main.py
99
+ from pydantic import BaseModel
100
+ from flashapi.fastapi import FlashAPI
101
+
102
+ class Product(BaseModel):
103
+ name: str
104
+ price: float
105
+ in_stock: bool = True
106
+
107
+ app = FlashAPI(models=[Product]).app
108
+ ```
109
+
110
+ ```bash
111
+ uvicorn main:app --reload
112
+ # Open http://localhost:8000/docs
113
+ ```
114
+
115
+ ### FastAPI (existing project)
116
+
117
+ ```python
118
+ # main.py — you already have app = FastAPI(...)
119
+ from fastapi import FastAPI
120
+ from flashapi.fastapi import FlashAPI
121
+ from models import Product, Order
122
+
123
+ app = FastAPI(title="My App")
124
+
125
+ # Your existing routes stay untouched
126
+ @app.get("/health")
127
+ async def health():
128
+ return {"ok": True}
129
+
130
+ # Mount FlashAPI under /api
131
+ flash = FlashAPI(models=[Product, Order])
132
+ app.mount("/api", flash.app)
133
+ ```
134
+
135
+ See [Integration Guide](docs/integration.md) for all patterns (Option A/B/C).
136
+
137
+ ### Django
138
+
139
+ ```python
140
+ # urls.py
141
+ from django.urls import path, include
142
+ from flashapi.django import generate_urls
143
+ from myapp.models import Product, Order, Customer
144
+
145
+ urlpatterns = [
146
+ path("admin/", admin.site.urls),
147
+ path("api/", include(generate_urls(models=[Product, Order, Customer]))),
148
+ ]
149
+ ```
150
+
151
+ Open `http://localhost:8000/api/docs/` for Swagger UI.
152
+
153
+ ### Flask
154
+
155
+ ```python
156
+ # app.py
157
+ from flask import Flask
158
+ from flashapi.flask import register_models
159
+ from models import Product, Order
160
+
161
+ app = Flask(__name__)
162
+ register_models(app, models=[Product, Order])
163
+ ```
164
+
165
+ Open `http://localhost:5000/docs` for Swagger UI.
166
+
167
+ ---
168
+
169
+ ## What you get
170
+
171
+ For every model, FlashAPI generates:
172
+
173
+ ```
174
+ GET /{plural}/ → List (paginated, filterable, sortable, searchable)
175
+ POST /{plural}/ → Create
176
+ GET /{plural}/{id}/ → Read
177
+ PUT /{plural}/{id}/ → Update
178
+ DELETE /{plural}/{id}/ → Delete
179
+ GET /{parent}/{id}/{children}/ → Nested list (auto-detected relations)
180
+ ```
181
+
182
+ Plus: `?expand=relation` to inline related objects, and Swagger UI docs.
183
+
184
+ ---
185
+
186
+ ## Model support
187
+
188
+ | Type | Detection | Storage |
189
+ |------|-----------|---------|
190
+ | Django Model | `_meta` attribute | Django ORM (your DB) |
191
+ | SQLAlchemy | `__table__` attribute | Your SQLAlchemy engine |
192
+ | Pydantic | `model_fields` attribute | Auto SQLite |
193
+ | dataclass | `@dataclass` | Auto SQLite |
194
+
195
+ ---
196
+
197
+ ## Customization
198
+
199
+ ```python
200
+ from flashapi import Model
201
+
202
+ FlashAPI(models=[
203
+ Product, # Full CRUD
204
+ Model(Order, exclude=["delete"]), # No delete
205
+ Model(Config, readonly=True), # GET only
206
+ Model(Log, only=["list"]), # List only
207
+ Model(Animal, plural="animaux"), # Custom plural
208
+ ])
209
+ ```
210
+
211
+ See [Customization docs](docs/customization.md) for all options.
212
+
213
+ ---
214
+
215
+ ## Authentication
216
+
217
+ FlashAPI does NOT handle auth. You protect routes using your framework's standard mechanisms:
218
+
219
+ - **Django**: middleware ([example](docs/authentication.md#django-middleware))
220
+ - **FastAPI**: dependencies / middleware ([example](docs/authentication.md#fastapi-dependency-injection))
221
+ - **Flask**: `before_request` ([example](docs/authentication.md#flask-before_request))
222
+
223
+ See [Authentication docs](docs/authentication.md) for full examples including RBAC, JWT, API keys.
224
+
225
+ ---
226
+
227
+ ## Custom business logic
228
+
229
+ FlashAPI does not interfere with your project. Add custom endpoints alongside:
230
+
231
+ ```python
232
+ # FlashAPI handles CRUD
233
+ flash = FlashAPI(models=[Product, Order])
234
+ app = flash.app
235
+
236
+ # You handle business logic
237
+ @app.post("/checkout")
238
+ async def checkout(request):
239
+ # Payment, emails, inventory...
240
+ return {"order_id": 42}
241
+ ```
242
+
243
+ See [Custom Logic docs](docs/custom-logic.md) for patterns and decision guide.
244
+
245
+ ---
246
+
247
+ ## Philosophy
248
+
249
+ - **FlashAPI handles CRUD, you handle business logic.** No black magic, no monkey-patching.
250
+ - **Zero intrusion.** Does not modify your models, migrations, or existing code.
251
+ - **Composable.** Use it for 2 models or 20. Mix with custom endpoints freely.
252
+ - **No opinion on auth.** Your project, your rules.
253
+ - **Framework-native.** Generates standard routes. No lock-in, no proprietary runtime.
254
+
255
+ ---
256
+
257
+ ## License
258
+
259
+ MIT
@@ -0,0 +1,39 @@
1
+ flashapi/__init__.py,sha256=0ktyPPBJUvxjAto0CHzDGPZEJ2pI0mgMZ_dTM15mgRI,290
2
+ flashapi/django.py,sha256=wsKMGpFNNSnSjV-TaI3H07SLwJnff7bD6SV9M1WxKwE,140
3
+ flashapi/fastapi.py,sha256=pW4UYDD1IFBJZPcynLmA468hb_oPPbhn8ClRXxNf2Dc,132
4
+ flashapi/flask.py,sha256=ZUxdHO3i2vgVC2gjhkHIZpQVyJ1fmrgBsdWMreWrKM0,142
5
+ flashapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ flashapi/adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ flashapi/adapters/base.py,sha256=qv3UZPePMZqLERJqMsdugbe_xdB2rkYOUwx9E7NgiFo,304
8
+ flashapi/adapters/django.py,sha256=XERqdgNjQsgH2gh_TuZiQjn-fdIpvsrJQh_w-awkR28,6907
9
+ flashapi/adapters/fastapi.py,sha256=sVRkgA9efsL9dRmVlLt3tRRhCfEOjh9G1_HSCScF2Kc,12541
10
+ flashapi/adapters/flask.py,sha256=KjG8cl6mhoeydWq4xntPqcusRpdqqTxQBXlEe_lJfOo,9412
11
+ flashapi/core/__init__.py,sha256=RsBTdHf6vwSFH50BJBodogK_MJNAOv4JHNnPgHNBpYw,177
12
+ flashapi/core/custom_routes.py,sha256=IOc4Nn_eTqrzPA_LLbYyuRnfDpKcCyiE5Xz5njtdFwc,8428
13
+ flashapi/core/pluralize.py,sha256=3jzIRO-50cOZs8kt-aCG26QbaDedF8Egp_sc_EGhqL8,2486
14
+ flashapi/core/relations.py,sha256=ZeIv5JEs9tY6aP4W3iVrtRixRn2hJVvUpe7VGXcfFvw,2307
15
+ flashapi/core/response.py,sha256=6UUWR6IflTuISALu_P_7aVEgoR68iG5c_eOJ8Q6_8Ng,885
16
+ flashapi/core/schema.py,sha256=6FbSwBn08BGdxaR3QAFel4l729ScpOsdxRPGZ1sYN_U,2066
17
+ flashapi/docs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
+ flashapi/docs/openapi.py,sha256=cYy0q5hEyEF6CvaFEd_C5XNUQPAAaloIxzd39kIDTOw,8281
19
+ flashapi/features/__init__.py,sha256=-0rOQ6vGvK3dWthPfcPHgZjs17RgGQ_E6QJw6lXB7lQ,286
20
+ flashapi/features/filtering.py,sha256=XJC-5QmVLXvn6C2nhvLFWnUtChz4jvwHPFD5TI78BHQ,842
21
+ flashapi/features/pagination.py,sha256=TJsL3Byofaaa4eH6vgGP1TeWDJ4VmNcUjSXPVKiWXyw,516
22
+ flashapi/features/search.py,sha256=yLOPYNOPqrcxeES0xNxooDv4yVOf99HihwlWflfG1N4,636
23
+ flashapi/features/sorting.py,sha256=fgsNMeN2AEzHROgWpl9gOlUOhccWePbzhJcfywnepTI,527
24
+ flashapi/inspectors/__init__.py,sha256=OUAru4OtHLbz0K1IGgttVBNmC_5zX45FCpHmDW1wr0I,85
25
+ flashapi/inspectors/base.py,sha256=ADYlfZVhIC_dvj3cB7hnWgI69xtmp8n7Zs0_IfT7p-Y,269
26
+ flashapi/inspectors/dataclass.py,sha256=MgD468p339Y_YgSYtMiYntl7WTOQVwM5lYUbfbbZr1o,1378
27
+ flashapi/inspectors/detect.py,sha256=3kNN4UGbk8232_ctFpQmY_ExELZDeIQ3xMhF8u6yIyk,1585
28
+ flashapi/inspectors/django.py,sha256=z1cvHhY4eDHzhhhEhjnKqOBtOz7-2s6WI3emEmqnqU4,3205
29
+ flashapi/inspectors/pydantic.py,sha256=cIvzqRS8ovM-N3LSmXQRBQ5-of2-OTu9mnupsufyMso,2996
30
+ flashapi/inspectors/sqlalchemy.py,sha256=zCY7v-ugvDT1vkUlaVbMC3J1norVDtZbqkMQt7EqSGw,2809
31
+ flashapi/storage/__init__.py,sha256=ykEwUTl-C9sP0eHYIf1w3D9iuPVnO176Pm-muXPUzAI,130
32
+ flashapi/storage/auto.py,sha256=7tqlUZ_327jPpzZbjcbv4yCYUN-jZthhLJCkjPXHKPE,3947
33
+ flashapi/storage/base.py,sha256=b5gBj7j6DdY7AXrHnZ0Fj1o0SLND4z4lXsWzjNyIMhc,680
34
+ flashapi/storage/orm.py,sha256=2NlF8JK69R0bR1UiZe6YcUM7TJGB5oYRvcviwiRJ7nY,2919
35
+ flashapi/storage/sqlalchemy.py,sha256=o1rK2GmGvynj_zVdgvAHFqgWykt5Pe2GyKhuOm0bxb0,4697
36
+ python_flashapi-0.1.0.dist-info/METADATA,sha256=Bqwqbtqzd34-jdOk5YA17bLniM90o16-jbMIisQ5P54,7939
37
+ python_flashapi-0.1.0.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
38
+ python_flashapi-0.1.0.dist-info/licenses/LICENSE,sha256=w0eWMxyBEZ3WUTFwSIdU-42zIv0zJC5dcwH2XUXrrds,1099
39
+ python_flashapi-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.31.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 FlashAPI 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.