Extract source-code dependencies and build dependency graphs.
Project description
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
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
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
from modwire import supported_languages
print(supported_languages())
# ("python", "typescript", "php")
Language-specific source IDs can be normalized without running a full extraction:
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.
from modwire.architecture import ArchitecturePolicyEvaluator, supported_analyzers
print(supported_analyzers())
# ("backward-flow", "no-reentry", "no-cycles")
evaluator = ArchitecturePolicyEvaluator()
Development
uv run ruff check
uv run pytest
uv run python -m build --outdir dist
uv run twine check dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file modwire-1.1.0.tar.gz.
File metadata
- Download URL: modwire-1.1.0.tar.gz
- Upload date:
- Size: 82.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ac18bcaf15bb8f7932b7e085cac18292fe8bda7cdee8345bbe9ea1ea1d9e82f
|
|
| MD5 |
6f6c4b47284243a6913510107c85b9a5
|
|
| BLAKE2b-256 |
1f0a4fd8146f024bdabac01e43d0582219bebfea416e957b3ec938689993ddba
|
Provenance
The following attestation bundles were made for modwire-1.1.0.tar.gz:
Publisher:
release.yml on 9orky/modwire
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modwire-1.1.0.tar.gz -
Subject digest:
5ac18bcaf15bb8f7932b7e085cac18292fe8bda7cdee8345bbe9ea1ea1d9e82f - Sigstore transparency entry: 1661990454
- Sigstore integration time:
-
Permalink:
9orky/modwire@371c8ff6edc8bfe6530824043a0e1be424050fc9 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/9orky
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@371c8ff6edc8bfe6530824043a0e1be424050fc9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file modwire-1.1.0-py3-none-any.whl.
File metadata
- Download URL: modwire-1.1.0-py3-none-any.whl
- Upload date:
- Size: 36.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eac763f33dce800a9da05810b6c599d3ec19d4fa90aed353c001bab321d3d5ad
|
|
| MD5 |
ac6578956fca52b0d36b728a8d1f9082
|
|
| BLAKE2b-256 |
7daeaa8c33c0a6a0929eada492b7ab464af63ede04503e3258c8f3b2ce0dd870
|
Provenance
The following attestation bundles were made for modwire-1.1.0-py3-none-any.whl:
Publisher:
release.yml on 9orky/modwire
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modwire-1.1.0-py3-none-any.whl -
Subject digest:
eac763f33dce800a9da05810b6c599d3ec19d4fa90aed353c001bab321d3d5ad - Sigstore transparency entry: 1661990527
- Sigstore integration time:
-
Permalink:
9orky/modwire@371c8ff6edc8bfe6530824043a0e1be424050fc9 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/9orky
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@371c8ff6edc8bfe6530824043a0e1be424050fc9 -
Trigger Event:
release
-
Statement type: