fastapi-voyager 0.16.0a3__tar.gz → 0.16.1__tar.gz
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_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/PKG-INFO +32 -20
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/README.md +31 -19
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/setup-litestar.sh +2 -2
- fastapi_voyager-0.16.1/src/fastapi_voyager/version.py +2 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/litestar/demo.py +4 -1
- fastapi_voyager-0.16.1/tests/litestar/embedding.py +44 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/test_embedding_litestar.py +3 -3
- fastapi_voyager-0.16.0a3/src/fastapi_voyager/version.py +0 -2
- fastapi_voyager-0.16.0a3/tests/litestar/embedding.py +0 -53
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/.githooks/README.md +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/.githooks/pre-commit +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/.github/workflows/publish.yml +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/.gitignore +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/.prettierignore +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/.prettierrc +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/.python-version +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/CONTRIBUTING.md +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/LICENSE +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/docs/changelog.md +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/docs/claude/0_REFACTORING_RENDER_NOTES.md +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/docs/idea.md +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/package-lock.json +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/pyproject.toml +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/release.md +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/setup-django-ninja.sh +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/setup-fastapi.sh +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/setup-hooks.sh +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/__init__.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/adapters/__init__.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/adapters/base.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/adapters/common.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/adapters/django_ninja_adapter.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/adapters/fastapi_adapter.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/adapters/litestar_adapter.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/cli.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/er_diagram.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/filter.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/introspectors/__init__.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/introspectors/base.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/introspectors/detector.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/introspectors/django_ninja.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/introspectors/fastapi.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/introspectors/litestar.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/module.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/pydantic_resolve_util.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/render.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/render_style.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/server.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/dot/cluster.j2 +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/dot/cluster_container.j2 +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/dot/digraph.j2 +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/dot/er_diagram.j2 +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/dot/link.j2 +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/dot/route_node.j2 +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/dot/schema_node.j2 +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/dot/tag_node.j2 +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/html/colored_text.j2 +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/html/pydantic_meta.j2 +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/html/schema_field_row.j2 +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/html/schema_header.j2 +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/html/schema_table.j2 +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/type.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/type_helper.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/voyager.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/component/demo.js +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/component/render-graph.js +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/component/route-code-display.js +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/component/schema-code-display.js +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/graph-ui.js +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/graphviz.svg.css +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/graphviz.svg.js +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/icon/android-chrome-192x192.png +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/icon/android-chrome-512x512.png +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/icon/apple-touch-icon.png +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/icon/favicon-16x16.png +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/icon/favicon-32x32.png +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/icon/favicon.ico +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/icon/site.webmanifest +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/index.html +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/quasar.min.css +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/quasar.min.js +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/store.js +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/vue-main.js +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/README.md +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/__init__.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/django_ninja/__init__.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/django_ninja/demo.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/django_ninja/embedding.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/django_ninja/settings.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/django_ninja/urls.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/embedding_test_utils.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/fastapi/__init__.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/fastapi/demo.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/fastapi/demo_anno.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/fastapi/embedding.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/litestar/__init__.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/service/__init__.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/service/schema/__init__.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/service/schema/base_entity.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/service/schema/extra.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/service/schema/schema.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/test_adapter_interface.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/test_analysis.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/test_embedding_django_ninja.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/test_embedding_fastapi.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/test_filter.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/test_generic.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/test_import.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/test_module.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/test_resolve_util_impl.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/tests/test_type_helper.py +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/uv.lock +0 -0
- {fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/voyager.jpg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fastapi-voyager
|
|
3
|
-
Version: 0.16.
|
|
3
|
+
Version: 0.16.1
|
|
4
4
|
Summary: Visualize FastAPI application's routing tree and dependencies
|
|
5
5
|
Project-URL: Homepage, https://github.com/allmonday/fastapi-voyager
|
|
6
6
|
Project-URL: Source, https://github.com/allmonday/fastapi-voyager
|
|
@@ -205,34 +205,44 @@ uvicorn your_app:application --reload
|
|
|
205
205
|
|
|
206
206
|
### Litestar
|
|
207
207
|
|
|
208
|
+
Litestar doesn't support mounting to an existing app like FastAPI. The recommended pattern is to export `ROUTE_HANDLERS` from your main app:
|
|
209
|
+
|
|
208
210
|
```python
|
|
209
|
-
|
|
210
|
-
from
|
|
211
|
+
# In your main app file (e.g., app.py)
|
|
212
|
+
from litestar import Litestar, Controller
|
|
211
213
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
+
class MyController(Controller):
|
|
215
|
+
# ... your routes ...
|
|
214
216
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
217
|
+
ROUTE_HANDLERS = [MyController] # Export for extension
|
|
218
|
+
app = Litestar(route_handlers=ROUTE_HANDLERS)
|
|
219
|
+
```
|
|
218
220
|
|
|
219
|
-
|
|
220
|
-
voyager_app = create_voyager(app)
|
|
221
|
+
Then create voyager by reusing `ROUTE_HANDLERS`:
|
|
221
222
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
223
|
+
```python
|
|
224
|
+
# In your voyager embedding file
|
|
225
|
+
from typing import Any, Awaitable, Callable
|
|
226
|
+
from litestar import Litestar, asgi
|
|
227
|
+
from fastapi_voyager import create_voyager
|
|
228
|
+
from your_app import ROUTE_HANDLERS, app as your_app
|
|
229
|
+
|
|
230
|
+
voyager_app = create_voyager(your_app)
|
|
231
|
+
|
|
232
|
+
@asgi("/voyager", is_mount=True, copy_scope=True)
|
|
233
|
+
async def voyager_mount(
|
|
234
|
+
scope: dict[str, Any],
|
|
235
|
+
receive: Callable[[], Awaitable[dict[str, Any]]],
|
|
236
|
+
send: Callable[[dict[str, Any]], Awaitable[None]]
|
|
237
|
+
) -> None:
|
|
238
|
+
await voyager_app(scope, receive, send)
|
|
239
|
+
|
|
240
|
+
app = Litestar(route_handlers=ROUTE_HANDLERS + [voyager_mount])
|
|
231
241
|
```
|
|
232
242
|
|
|
233
243
|
Start with:
|
|
234
244
|
```bash
|
|
235
|
-
uvicorn your_app:
|
|
245
|
+
uvicorn your_app:app --reload
|
|
236
246
|
# Visit http://localhost:8000/voyager
|
|
237
247
|
```
|
|
238
248
|
|
|
@@ -335,6 +345,8 @@ voyager -m tests.demo --server --port=8002
|
|
|
335
345
|
voyager -m tests.demo --server --app my_app
|
|
336
346
|
```
|
|
337
347
|
|
|
348
|
+
> **Note**: Server mode does not support ER diagram or pydantic-resolve metadata configuration. Use `create_voyager()` in your code with `er_diagram` and `enable_pydantic_resolve_meta` parameters to enable these features.
|
|
349
|
+
|
|
338
350
|
### Generate DOT File
|
|
339
351
|
|
|
340
352
|
```bash
|
|
@@ -154,34 +154,44 @@ uvicorn your_app:application --reload
|
|
|
154
154
|
|
|
155
155
|
### Litestar
|
|
156
156
|
|
|
157
|
+
Litestar doesn't support mounting to an existing app like FastAPI. The recommended pattern is to export `ROUTE_HANDLERS` from your main app:
|
|
158
|
+
|
|
157
159
|
```python
|
|
158
|
-
|
|
159
|
-
from
|
|
160
|
+
# In your main app file (e.g., app.py)
|
|
161
|
+
from litestar import Litestar, Controller
|
|
160
162
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
+
class MyController(Controller):
|
|
164
|
+
# ... your routes ...
|
|
163
165
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
ROUTE_HANDLERS = [MyController] # Export for extension
|
|
167
|
+
app = Litestar(route_handlers=ROUTE_HANDLERS)
|
|
168
|
+
```
|
|
167
169
|
|
|
168
|
-
|
|
169
|
-
voyager_app = create_voyager(app)
|
|
170
|
+
Then create voyager by reusing `ROUTE_HANDLERS`:
|
|
170
171
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
172
|
+
```python
|
|
173
|
+
# In your voyager embedding file
|
|
174
|
+
from typing import Any, Awaitable, Callable
|
|
175
|
+
from litestar import Litestar, asgi
|
|
176
|
+
from fastapi_voyager import create_voyager
|
|
177
|
+
from your_app import ROUTE_HANDLERS, app as your_app
|
|
178
|
+
|
|
179
|
+
voyager_app = create_voyager(your_app)
|
|
180
|
+
|
|
181
|
+
@asgi("/voyager", is_mount=True, copy_scope=True)
|
|
182
|
+
async def voyager_mount(
|
|
183
|
+
scope: dict[str, Any],
|
|
184
|
+
receive: Callable[[], Awaitable[dict[str, Any]]],
|
|
185
|
+
send: Callable[[dict[str, Any]], Awaitable[None]]
|
|
186
|
+
) -> None:
|
|
187
|
+
await voyager_app(scope, receive, send)
|
|
188
|
+
|
|
189
|
+
app = Litestar(route_handlers=ROUTE_HANDLERS + [voyager_mount])
|
|
180
190
|
```
|
|
181
191
|
|
|
182
192
|
Start with:
|
|
183
193
|
```bash
|
|
184
|
-
uvicorn your_app:
|
|
194
|
+
uvicorn your_app:app --reload
|
|
185
195
|
# Visit http://localhost:8000/voyager
|
|
186
196
|
```
|
|
187
197
|
|
|
@@ -284,6 +294,8 @@ voyager -m tests.demo --server --port=8002
|
|
|
284
294
|
voyager -m tests.demo --server --app my_app
|
|
285
295
|
```
|
|
286
296
|
|
|
297
|
+
> **Note**: Server mode does not support ER diagram or pydantic-resolve metadata configuration. Use `create_voyager()` in your code with `er_diagram` and `enable_pydantic_resolve_meta` parameters to enable these features.
|
|
298
|
+
|
|
287
299
|
### Generate DOT File
|
|
288
300
|
|
|
289
301
|
```bash
|
|
@@ -39,10 +39,10 @@ echo ""
|
|
|
39
39
|
|
|
40
40
|
# Start Litestar server
|
|
41
41
|
echo "🌟 Starting Litestar Voyager server..."
|
|
42
|
-
echo " App: tests.litestar.embedding:
|
|
42
|
+
echo " App: tests.litestar.embedding:app"
|
|
43
43
|
echo " URL: http://127.0.0.1:8000"
|
|
44
44
|
echo ""
|
|
45
45
|
echo "Press Ctrl+C to stop the server"
|
|
46
46
|
echo ""
|
|
47
47
|
|
|
48
|
-
uv run uvicorn tests.litestar.embedding:
|
|
48
|
+
uv run uvicorn tests.litestar.embedding:app --reload --host 127.0.0.1 --port 8000
|
|
@@ -132,7 +132,10 @@ class DemoController(Controller):
|
|
|
132
132
|
return True
|
|
133
133
|
|
|
134
134
|
|
|
135
|
+
# Export route handlers for extension (e.g., adding voyager)
|
|
136
|
+
ROUTE_HANDLERS = [DemoController]
|
|
137
|
+
|
|
135
138
|
# Create a Litestar app instance - this is the main app that can be run directly
|
|
136
139
|
app = Litestar(
|
|
137
|
-
route_handlers=
|
|
140
|
+
route_handlers=ROUTE_HANDLERS
|
|
138
141
|
)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Litestar embedding example for fastapi-voyager.
|
|
3
|
+
|
|
4
|
+
This module demonstrates how to integrate voyager with a Litestar application.
|
|
5
|
+
|
|
6
|
+
Unlike FastAPI, Litestar doesn't support mounting to an existing app after creation.
|
|
7
|
+
The recommended pattern is to reuse the ROUTE_HANDLERS from demo.py.
|
|
8
|
+
"""
|
|
9
|
+
from typing import Any, Awaitable, Callable
|
|
10
|
+
|
|
11
|
+
from litestar import Litestar, asgi
|
|
12
|
+
|
|
13
|
+
from fastapi_voyager import create_voyager
|
|
14
|
+
from tests.litestar.demo import ROUTE_HANDLERS, app as demo_app, diagram
|
|
15
|
+
|
|
16
|
+
# Create voyager app (returns a Litestar app)
|
|
17
|
+
voyager_app = create_voyager(
|
|
18
|
+
demo_app,
|
|
19
|
+
er_diagram=diagram,
|
|
20
|
+
module_color={"tests.service": "purple"},
|
|
21
|
+
module_prefix="tests.service",
|
|
22
|
+
swagger_url="/schema/swagger",
|
|
23
|
+
initial_page_policy='first',
|
|
24
|
+
ga_id='G-R64S7Q49VL',
|
|
25
|
+
online_repo_url="https://github.com/allmonday/fastapi-voyager/blob/main",
|
|
26
|
+
enable_pydantic_resolve_meta=True
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
# Mount voyager using Litestar's @asgi() decorator
|
|
30
|
+
@asgi("/voyager", is_mount=True, copy_scope=True)
|
|
31
|
+
async def voyager_mount(
|
|
32
|
+
scope: dict[str, Any],
|
|
33
|
+
receive: Callable[[], Awaitable[dict[str, Any]]],
|
|
34
|
+
send: Callable[[dict[str, Any]], Awaitable[None]]
|
|
35
|
+
) -> None:
|
|
36
|
+
await voyager_app(scope, receive, send)
|
|
37
|
+
|
|
38
|
+
# Create combined app by reusing ROUTE_HANDLERS from demo.py
|
|
39
|
+
# This is the recommended pattern for Litestar
|
|
40
|
+
app = Litestar(route_handlers=ROUTE_HANDLERS + [voyager_mount])
|
|
41
|
+
|
|
42
|
+
# Exports
|
|
43
|
+
# - Use `uvicorn tests.litestar.embedding:app --reload` for combined app
|
|
44
|
+
# - Use `uvicorn tests.litestar.embedding:demo_app --reload` for demo only
|
|
@@ -24,11 +24,11 @@ def event_loop() -> Generator[asyncio.AbstractEventLoop, None, None]:
|
|
|
24
24
|
@pytest_asyncio.fixture
|
|
25
25
|
async def async_client() -> AsyncGenerator[httpx.AsyncClient, None]:
|
|
26
26
|
"""Create an async HTTP client for testing Litestar embedding."""
|
|
27
|
-
# Import the
|
|
28
|
-
from tests.litestar.embedding import
|
|
27
|
+
# Import the combined app from tests.litestar.embedding
|
|
28
|
+
from tests.litestar.embedding import app
|
|
29
29
|
|
|
30
30
|
# Use ASGITransport for testing ASGI apps with httpx
|
|
31
|
-
transport = httpx.ASGITransport(app=
|
|
31
|
+
transport = httpx.ASGITransport(app=app)
|
|
32
32
|
async with httpx.AsyncClient(transport=transport, base_url="http://test") as client:
|
|
33
33
|
yield client
|
|
34
34
|
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Litestar embedding example for fastapi-voyager.
|
|
3
|
-
|
|
4
|
-
This module demonstrates how to integrate voyager with a Litestar application.
|
|
5
|
-
"""
|
|
6
|
-
from fastapi_voyager import create_voyager
|
|
7
|
-
from tests.litestar.demo import app, diagram
|
|
8
|
-
|
|
9
|
-
# Create voyager app for visualization
|
|
10
|
-
# Note: create_voyager automatically detects Litestar and returns a Litestar app
|
|
11
|
-
voyager_app = create_voyager(
|
|
12
|
-
app,
|
|
13
|
-
er_diagram=diagram,
|
|
14
|
-
module_color={"tests.service": "purple"},
|
|
15
|
-
module_prefix="tests.service",
|
|
16
|
-
swagger_url="/schema/swagger",
|
|
17
|
-
initial_page_policy='first',
|
|
18
|
-
ga_id='G-R64S7Q49VL',
|
|
19
|
-
online_repo_url="https://github.com/allmonday/fastapi-voyager/blob/main",
|
|
20
|
-
enable_pydantic_resolve_meta=True
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
# ASGI app that routes between main app and voyager
|
|
24
|
-
# This allows voyager to be accessed at /voyager while the main app handles other routes
|
|
25
|
-
async def asgi_app(scope, receive, send):
|
|
26
|
-
"""
|
|
27
|
-
ASGI app that routes between main app and voyager.
|
|
28
|
-
|
|
29
|
-
Usage:
|
|
30
|
-
uvicorn tests.litestar.embedding:asgi_app --reload
|
|
31
|
-
|
|
32
|
-
Then access:
|
|
33
|
-
- http://localhost:8000/demo/* for the main app
|
|
34
|
-
- http://localhost:8000/voyager for voyager UI
|
|
35
|
-
"""
|
|
36
|
-
if scope["type"] == "http" and scope["path"].startswith("/voyager"):
|
|
37
|
-
# Forward to voyager app
|
|
38
|
-
# Remove /voyager prefix for the voyager app (it expects root path)
|
|
39
|
-
new_scope = dict(scope)
|
|
40
|
-
new_scope["path"] = scope["path"][8:] # Remove '/voyager'
|
|
41
|
-
if new_scope["path"] == "":
|
|
42
|
-
new_scope["path"] = "/"
|
|
43
|
-
if "raw_path" in new_scope:
|
|
44
|
-
new_scope["raw_path"] = scope["raw_path"][8:]
|
|
45
|
-
await voyager_app(new_scope, receive, send)
|
|
46
|
-
else:
|
|
47
|
-
# Forward to main app
|
|
48
|
-
await app(scope, receive, send)
|
|
49
|
-
|
|
50
|
-
# Exports
|
|
51
|
-
# - Use `uvicorn tests.litestar.embedding:asgi_app --reload` for combined app (main + voyager at /voyager)
|
|
52
|
-
# - Use `uvicorn tests.litestar.embedding:app --reload` for main app only
|
|
53
|
-
# - Use `uvicorn tests.litestar.embedding:voyager_app --reload` for voyager only
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/.github/ISSUE_TEMPLATE/feature_request.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/docs/claude/0_REFACTORING_RENDER_NOTES.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/adapters/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/adapters/fastapi_adapter.py
RENAMED
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/adapters/litestar_adapter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/introspectors/__init__.py
RENAMED
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/introspectors/base.py
RENAMED
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/introspectors/detector.py
RENAMED
|
File without changes
|
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/introspectors/fastapi.py
RENAMED
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/introspectors/litestar.py
RENAMED
|
File without changes
|
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/pydantic_resolve_util.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/dot/cluster.j2
RENAMED
|
File without changes
|
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/dot/digraph.j2
RENAMED
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/dot/er_diagram.j2
RENAMED
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/dot/link.j2
RENAMED
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/dot/route_node.j2
RENAMED
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/dot/schema_node.j2
RENAMED
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/templates/dot/tag_node.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/component/demo.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/graphviz.svg.css
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/icon/favicon-16x16.png
RENAMED
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/icon/favicon-32x32.png
RENAMED
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/icon/favicon.ico
RENAMED
|
File without changes
|
{fastapi_voyager-0.16.0a3 → fastapi_voyager-0.16.1}/src/fastapi_voyager/web/icon/site.webmanifest
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|