Metadata-Version: 2.4
Name: trailmap
Version: 0.3.0
Summary: Map a Python source tree into typed-edge markdown for fast AI navigation.
Project-URL: Homepage, https://github.com/bitranch/trailmap
Project-URL: Source, https://github.com/bitranch/trailmap
Author-email: William Schindler <bill@bitranch.com>
License: MIT License
        
        Copyright (c) 2026 William Schindler
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: ast,code-analysis,code-map,llm,markdown,static-analysis
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Documentation
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Provides-Extra: typescript
Requires-Dist: tree-sitter-typescript<0.24,>=0.23; extra == 'typescript'
Requires-Dist: tree-sitter<0.27,>=0.24; extra == 'typescript'
Description-Content-Type: text/markdown

# Trailmap

Map a source tree into typed-edge markdown so an AI can find any symbol and see
how it connects without reading the source. Python and TypeScript. Design and
rationale in [DESIGN.md](DESIGN.md).

Python analysis uses the standard library only. Other languages are opt-in
extras, so the base install stays dependency-free.

## Install

```
pip install trailmap                # Python analysis, zero dependencies
pip install trailmap[typescript]    # adds TypeScript/TSX (tree-sitter)
```

Installs a `trailmap` console command. Or run it in place: `python -m trailmap ...`.

## Languages

Python (stdlib `ast`, always available) and TypeScript/TSX (tree-sitter, the
`typescript` extra). Trailmap maps whatever it recognizes in a tree and skips
files whose language extra isn't installed, telling you what to install. Each
new language is an adapter behind its own extra; the core stays pure Python.

## Run

```
python -m trailmap <source-tree> -o <output-dir>
```

Map Trailmap's own source (the demo):

```
python -m trailmap trailmap -o trailmap-out
```

## Output

- `INDEX.md` — front door and how-to-read.
- `modules/<module>.md` — one page per module; frontmatter has imports, body has
  a section per symbol with its edges.
- `symbols.tsv` — `fqn  kind  file  line  signature`. Grep this to locate a symbol.
- `edges.tsv` — `src  type  dst  confidence  resolved`. Grep `src` for dependencies,
  `dst` for dependents.
- `candidates.tsv` — for a `?`-unresolved call, the possible in-project targets
  (`caller  method  candidate  n_candidates`). A lead, kept out of `edges.tsv`.
- `trailmap.json` — the full structured graph.

Edges are `ast`/parser (precise, trust) or `heuristic` (a lead). Unresolved
targets keep a trailing `?`.

## Status

Early (0.1). Python (stdlib `ast`) and TypeScript/TSX (tree-sitter extra).
Resolution is best-effort without a type checker: it follows imports, inferred
receiver types, the inheritance chain, and in-project star imports, and offers
candidate leads for the rest. Limits are in DESIGN.md. The core is
language-agnostic; new languages are adapters behind their own extra.

## License

MIT. See [LICENSE](LICENSE).
