# `orchestrator.pkg.python_routes`
<!-- generated by `orchestrator understand`; the PKG is source of truth, edits here are advisory -->

[← Episteme](../README.md) · [Architecture](../architecture.md)

**Source:** [`src/orchestrator/pkg/python_routes.py`](../../src/orchestrator/pkg/python_routes.py)

2 types · 11 functions · python

## Changing this safely

**No test module imports this.**

**Most depended-upon here** — a change to these reaches the most code (call graph, ≤4 hops):

- [`_kwarg`](../../src/orchestrator/pkg/python_routes.py#L110) — reaches **5** symbols · **no test path visible**
- [`_literal_path`](../../src/orchestrator/pkg/python_routes.py#L94) — reaches **5** symbols · **no test path visible**
- [`PendingRoute`](../../src/orchestrator/pkg/python_routes.py#L64) — reaches **4** symbols · **no test path visible**
- [`_resolve_router`](../../src/orchestrator/pkg/python_routes.py#L145) — reaches **4** symbols · **no test path visible**
- [`_receiver`](../../src/orchestrator/pkg/python_routes.py#L138) — reaches **3** symbols · **no test path visible**
- [`_verbs_from_methods`](../../src/orchestrator/pkg/python_routes.py#L125) — reaches **3** symbols · **no test path visible**
- [`_collect_django`](../../src/orchestrator/pkg/python_routes.py#L248) — reaches **2** symbols · **no test path visible**
- [`_collect_routers`](../../src/orchestrator/pkg/python_routes.py#L175) — reaches **2** symbols · **no test path visible**

_13 of the symbols other code depends on here have no test path the graph can see — worth a second look before changing them. Absence of a path is not proof of absence of a test: calls through an attribute chain (`obj.method()`) are skipped rather than guessed at, so indirect coverage is invisible._

## Types

### `PendingRoute`

[`src/orchestrator/pkg/python_routes.py:64`](../../src/orchestrator/pkg/python_routes.py#L64)

- **Called by** (2): [`_collect_django`](../../src/orchestrator/pkg/python_routes.py#L248), [`_collect_routes`](../../src/orchestrator/pkg/python_routes.py#L204)
- **Fields**: `handler_id`, `path`, `provenance`, `router_key`, `verb`

### `RouteState`

[`src/orchestrator/pkg/python_routes.py:75`](../../src/orchestrator/pkg/python_routes.py#L75)

- **Called by** (1): [`__init__`](../../src/orchestrator/pkg/extractor.py#L161)
- **Fields**: `local_prefixes`, `mounts`, `routes`

## Functions

### `_collect_django`

[`src/orchestrator/pkg/python_routes.py:248`](../../src/orchestrator/pkg/python_routes.py#L248)

- **Called by** (1): [`scan_module`](../../src/orchestrator/pkg/python_routes.py#L160)
- **Calls** (5): [`PendingRoute`](../../src/orchestrator/pkg/python_routes.py#L64), [`Provenance`](../../src/orchestrator/pkg/facts.py#L81), [`_literal_path`](../../src/orchestrator/pkg/python_routes.py#L94), [`_resolve_router`](../../src/orchestrator/pkg/python_routes.py#L145), `walk`

### `_collect_routers`

[`src/orchestrator/pkg/python_routes.py:175`](../../src/orchestrator/pkg/python_routes.py#L175)

- **Called by** (1): [`scan_module`](../../src/orchestrator/pkg/python_routes.py#L160)
- **Calls** (4): [`_kwarg`](../../src/orchestrator/pkg/python_routes.py#L110), [`_literal_path`](../../src/orchestrator/pkg/python_routes.py#L94), [`_resolve_router`](../../src/orchestrator/pkg/python_routes.py#L145), `walk`

### `_collect_routes`

[`src/orchestrator/pkg/python_routes.py:204`](../../src/orchestrator/pkg/python_routes.py#L204)

- **Called by** (2): [`_collect_routes`](../../src/orchestrator/pkg/python_routes.py#L204), [`scan_module`](../../src/orchestrator/pkg/python_routes.py#L160)
- **Calls** (6): [`PendingRoute`](../../src/orchestrator/pkg/python_routes.py#L64), [`Provenance`](../../src/orchestrator/pkg/facts.py#L81), [`_collect_routes`](../../src/orchestrator/pkg/python_routes.py#L204), [`_literal_path`](../../src/orchestrator/pkg/python_routes.py#L94), [`_receiver`](../../src/orchestrator/pkg/python_routes.py#L138), [`_verbs_from_methods`](../../src/orchestrator/pkg/python_routes.py#L125)

### `_join`

[`src/orchestrator/pkg/python_routes.py:117`](../../src/orchestrator/pkg/python_routes.py#L117)

- **Called by** (1): [`emit`](../../src/orchestrator/pkg/python_routes.py#L283)

### `_kwarg`

[`src/orchestrator/pkg/python_routes.py:110`](../../src/orchestrator/pkg/python_routes.py#L110)

- **Called by** (2): [`_collect_routers`](../../src/orchestrator/pkg/python_routes.py#L175), [`_verbs_from_methods`](../../src/orchestrator/pkg/python_routes.py#L125)

### `_literal_path`

[`src/orchestrator/pkg/python_routes.py:94`](../../src/orchestrator/pkg/python_routes.py#L94)

- **Called by** (4): [`_collect_django`](../../src/orchestrator/pkg/python_routes.py#L248), [`_collect_routers`](../../src/orchestrator/pkg/python_routes.py#L175), [`_collect_routes`](../../src/orchestrator/pkg/python_routes.py#L204), [`_literal_path`](../../src/orchestrator/pkg/python_routes.py#L94)
- **Calls** (1): [`_literal_path`](../../src/orchestrator/pkg/python_routes.py#L94)

### `_receiver`

[`src/orchestrator/pkg/python_routes.py:138`](../../src/orchestrator/pkg/python_routes.py#L138)

- **Called by** (1): [`_collect_routes`](../../src/orchestrator/pkg/python_routes.py#L204)

### `_resolve_router`

[`src/orchestrator/pkg/python_routes.py:145`](../../src/orchestrator/pkg/python_routes.py#L145)

- **Called by** (2): [`_collect_django`](../../src/orchestrator/pkg/python_routes.py#L248), [`_collect_routers`](../../src/orchestrator/pkg/python_routes.py#L175)

### `_verbs_from_methods`

[`src/orchestrator/pkg/python_routes.py:125`](../../src/orchestrator/pkg/python_routes.py#L125)

- **Called by** (1): [`_collect_routes`](../../src/orchestrator/pkg/python_routes.py#L204)
- **Calls** (1): [`_kwarg`](../../src/orchestrator/pkg/python_routes.py#L110)

### `emit`

[`src/orchestrator/pkg/python_routes.py:283`](../../src/orchestrator/pkg/python_routes.py#L283)

- **Called by** (1): [`finalize`](../../src/orchestrator/pkg/extractor.py#L193)
- **Calls** (3): [`Edge`](../../src/orchestrator/pkg/facts.py#L137), [`Node`](../../src/orchestrator/pkg/facts.py#L121), [`_join`](../../src/orchestrator/pkg/python_routes.py#L117)
- **Documented in**: `docs/specs/build-documents/PKG-ACC-3-build.md#9-facts-the-generator-needs`, `docs/specs/build-documents/PKG-ACC-3-build.md#why-the-analysis-is-90`

### `scan_module`

[`src/orchestrator/pkg/python_routes.py:160`](../../src/orchestrator/pkg/python_routes.py#L160)

- **Called by** (1): [`extract`](../../src/orchestrator/pkg/extractor.py#L175)
- **Calls** (3): [`_collect_django`](../../src/orchestrator/pkg/python_routes.py#L248), [`_collect_routers`](../../src/orchestrator/pkg/python_routes.py#L175), [`_collect_routes`](../../src/orchestrator/pkg/python_routes.py#L204)
- **Documented in**: `docs/specs/build-documents/PKG-ACC-3-build.md#61-count-with-the-ast-not-the-regex`, `docs/specs/build-documents/PKG-ACC-3-build.md#9-facts-the-generator-needs`

## Imports

`__future__.annotations`, `ast`, `dataclasses.dataclass`, `dataclasses.field`, [`orchestrator.pkg.facts`](../../src/orchestrator/pkg/facts.py#L1)

## Imported by

[`orchestrator.pkg.extractor`](../../src/orchestrator/pkg/extractor.py#L1)
