croqui 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.
- croqui/__init__.py +3 -0
- croqui/adapters/__init__.py +30 -0
- croqui/adapters/fastapi_py.py +785 -0
- croqui/cli.py +438 -0
- croqui/context.py +395 -0
- croqui/docs.py +184 -0
- croqui/enrich.py +245 -0
- croqui/llm.py +286 -0
- croqui/mcp.py +353 -0
- croqui/model.py +193 -0
- croqui/prd.py +167 -0
- croqui/reconcile.py +380 -0
- croqui/scaffold.py +310 -0
- croqui/serve.py +243 -0
- croqui/tables.py +310 -0
- croqui/update.py +144 -0
- croqui/viewer/app.js +5338 -0
- croqui/viewer/diagram.js +763 -0
- croqui/viewer/index.html +134 -0
- croqui/viewer/style.css +1193 -0
- croqui-0.1.0.dist-info/METADATA +657 -0
- croqui-0.1.0.dist-info/RECORD +26 -0
- croqui-0.1.0.dist-info/WHEEL +5 -0
- croqui-0.1.0.dist-info/entry_points.txt +2 -0
- croqui-0.1.0.dist-info/licenses/LICENSE +21 -0
- croqui-0.1.0.dist-info/top_level.txt +1 -0
croqui/__init__.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""Per-stack scanners. Each adapter turns source code into graph nodes/edges."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
from .fastapi_py import FastApiScanner
|
|
8
|
+
|
|
9
|
+
ADAPTERS = {"python/fastapi": FastApiScanner}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def detect_stack(root: Path) -> str | None:
|
|
13
|
+
"""Best-effort stack detection, cheapest signal first."""
|
|
14
|
+
for candidate in ("requirements.txt", "pyproject.toml", "requirements-worker.txt"):
|
|
15
|
+
path = root / candidate
|
|
16
|
+
if path.is_file():
|
|
17
|
+
text = path.read_text(encoding="utf-8", errors="replace").lower()
|
|
18
|
+
if "fastapi" in text:
|
|
19
|
+
return "python/fastapi"
|
|
20
|
+
if list(root.glob("**/main.py")) and list(root.rglob("*.py")):
|
|
21
|
+
for path in root.rglob("*.py"):
|
|
22
|
+
if "__pycache__" in path.parts:
|
|
23
|
+
continue
|
|
24
|
+
head = path.read_text(encoding="utf-8", errors="replace")[:2000]
|
|
25
|
+
if "APIRouter" in head or "from fastapi" in head:
|
|
26
|
+
return "python/fastapi"
|
|
27
|
+
return None
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
__all__ = ["ADAPTERS", "FastApiScanner", "detect_stack"]
|