Metadata-Version: 2.4
Name: modwire
Version: 1.0.0
Summary: Extract source-code dependencies and build dependency graphs.
Author: Tomasz Szpak
License-Expression: MIT
Project-URL: Homepage, https://github.com/9orky/codemap
Project-URL: Repository, https://github.com/9orky/codemap
Project-URL: Issues, https://github.com/9orky/codemap/issues
Keywords: architecture,code-analysis,dependency-graph,static-analysis
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.8
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: ruff>=0.8; extra == "dev"
Requires-Dist: twine>=5.1; extra == "dev"
Dynamic: license-file

# modwire

`modwire` extracts source-code structure and import dependencies from Python,
TypeScript/JavaScript, and PHP projects. It returns typed Python objects that
you can use to build dependency graphs, inspect symbols, and evaluate
architecture rules.

## Installation

```bash
python -m pip install modwire
```

The Python extractor works with Python alone. TypeScript/JavaScript extraction
requires Node.js at runtime, and PHP extraction requires PHP at runtime.

## Quick Start

```python
from pathlib import Path

from modwire import extract_code

result = extract_code(
    "python",
    Path("src"),
    exclusions=("**/__pycache__/**",),
)

print(result.extraction_result.summary.files_checked)
print(result.graph.node_ids())
print([(edge.from_id, edge.to_id) for edge in result.graph.edges])
```

Graph nodes use canonical extensionless source IDs, so equivalent Python,
TypeScript, and PHP projects can be compared through the same graph shape.

## Supported Languages

```python
from modwire import supported_languages

print(supported_languages())
# ("python", "typescript", "php")
```

Language-specific source IDs can be normalized without running a full
extraction:

```python
from modwire import normalize_source_id

print(normalize_source_id("typescript", "src/view.tsx"))
# "src/view"
```

## Architecture Policy API

`modwire.architecture` exposes policy evaluation helpers for checking import
boundaries and common dependency-flow rules.

```python
from modwire.architecture import ArchitecturePolicyEvaluator, supported_analyzers

print(supported_analyzers())
# ("backward-flow", "no-reentry", "no-cycles")

evaluator = ArchitecturePolicyEvaluator()
```

## Development

```bash
uv run ruff check
uv run pytest
uv run python -m build --outdir dist
uv run twine check dist/*
```
