Skip to content

Commit 7ec3c45

Browse files
committed
Updating docs with new Python support
1 parent 1838322 commit 7ec3c45

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

ARCHITECTURE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ Each extractor is detected by characteristic project files and then parses what
336336
| Language | Parser | Detected by |
337337
|------------|------------------|-------------|
338338
| Go | `go/ast` | `go.mod` present |
339-
| Kotlin | regex scanner | `build.gradle.kts` / `build.gradle` with Kotlin/Android |
340-
| Python | regex scanner | `pyproject.toml`, `setup.py`, `requirements.txt`, `Pipfile`, `pytest.ini`, `mypy.ini`, or `tox.ini` (root or up to 3 levels deep) |
339+
| Kotlin | tree-sitter | `build.gradle.kts` / `build.gradle` with Kotlin/Android |
340+
| Python | tree-sitter | `pyproject.toml`, `setup.py`, `requirements.txt`, `Pipfile`, `pytest.ini`, `mypy.ini`, `tox.ini`, or `setup.cfg` (root or up to 3 levels deep) |
341341
| TypeScript | tree-sitter | `tsconfig.json`, `tsconfig.base.json`, or `package.json` with TypeScript (root or one level deep) |
342342
| Swift | tree-sitter | `Package.swift`, `.xcodeproj`, or `.xcworkspace` present |
343343
| Ruby | regex scanner | `Gemfile` present |
@@ -347,7 +347,7 @@ Each extractor is detected by characteristic project files and then parses what
347347

348348
**TypeScript** (tree-sitter) includes Next.js route detection (App Router and Pages Router), monorepo detection one level deep, and parsing of `openapi-typescript`-generated client files — each operation is emitted as a `route` fact with `role:"client"`. App Router route groups like `(standard)` are stripped from URLs.
349349

350-
**Python** uses indentation-based scope tracking for nested classes/methods, and understands FastAPI/Starlette route decorators (emitting `route` facts), SQLAlchemy `__tablename__` (emitting `storage` facts), Pydantic/dataclasses/ABCs/enums (as `class` symbols with `implements` edges per base), `async def`, and both `import` forms. Monorepo detection walks up to 3 levels.
350+
**Python** is parsed with tree-sitter (the concrete syntax tree handles nested classes/methods and docstrings natively, replacing the older indentation scanner). It understands **FastAPI/Starlette** route decorators and **Django** routes — `@api_view([...])` and `urls.py` `path()`/`re_path()` — emitting a `route` fact per endpoint. It emits `storage` facts for **SQLAlchemy** `__tablename__` and **Django models** (table name inferred from the class name), and classifies Django views and serializers via a `django_component` prop. It captures `async def` (`async: true`), decorator props (`@property`, `@staticmethod`, `@classmethod`, `@abstractmethod`, and Celery `@task`/`@shared_task`), and return-type hints. Each class emits an `implements` edge per base class, with generic type parameters stripped (`CRUDBase[Model, Id]` → `CRUDBase`), and both `import` forms become `dependency` facts. Crucially, the Python extractor now walks function and method bodies for call sites, emitting `calls` and `instantiates` edges (filtering out builtins) — so Python code participates in the dependency/call graph and is reachable by `traverse`, `find_path`, and `impact_analysis`. Monorepo detection walks up to 3 levels.
351351

352352
**Kotlin** is Android-aware: it detects Jetpack Compose (`@Composable`), Hilt DI (`@HiltViewModel`, `@Module`, `@AndroidEntryPoint`), Room (`@Entity`, `@Dao`, `@Database`), ViewModels, Repositories, Use Cases, and Workers.
353353

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,16 @@ Working across several repos? Generate the first, then add the rest with append
145145
|------------|-------------|
146146
| Go | `go.mod` |
147147
| TypeScript | `tsconfig.json` / `package.json` with TypeScript (Next.js & monorepo aware) |
148-
| Python | `pyproject.toml`, `requirements.txt`, `setup.py`, … (FastAPI / SQLAlchemy aware) |
148+
| Python | `pyproject.toml`, `requirements.txt`, `setup.py`, … (FastAPI / Django / SQLAlchemy aware) |
149149
| Kotlin | `build.gradle(.kts)` with Kotlin/Android (Compose / Hilt / Room aware) |
150150
| Swift | `Package.swift`, `.xcodeproj`, `.xcworkspace` (SwiftUI / UIKit aware) |
151151
| Ruby | `Gemfile` (Rails / ActiveRecord / Packwerk aware) |
152152
| OpenAPI | any spec with an `openapi:` / `swagger:` key |
153153

154154
Framework- and platform-specific detection for each language is described in **[ARCHITECTURE.md → Supported languages](ARCHITECTURE.md#supported-languages)**.
155155

156+
> Python is parsed with tree-sitter and now contributes call and dependency edges to the graph, so `traverse`, `find_path`, and `impact_analysis` reach into Python code — not just modules and routes.
157+
156158
---
157159

158160
## Build from source

0 commit comments

Comments
 (0)