Modwire Architecture
Modwire Architecture is the typed architecture library for the Modwire ecosystem. It analyzes extracted code maps in memory without owning extraction, presentation, hypermedia, filesystem, or command-line orchestration.
from modwire_architecture import ArchitectureConfig, Modwire
from modwire_extraction import QueryableCodeMap
def analyze(code_map: QueryableCodeMap):
return Modwire().architecture(ArchitectureConfig()).report(code_map)
Install the library with:
python -m pip install 'modwire-architecture>=7,<8'
Core accepts in-memory configuration and an already extracted code map. Callers own source discovery, configuration loading, and output handling.
Shape realms
Shape rules are configured through one or more required realms. A realm matches
source IDs with its own glob and is independent of architecture-boundary tags.
Each realm's shape object uses the standard shape-rule defaults; specify only
the values that differ for that realm.
architecture:
shape:
realms:
- name: project
match: "*"
shape:
max_function_lines: 40
- name: tests
match: tests/*
shape:
max_functions_per_file: -1
allow_optional_function_args: true
A source matching multiple realms is evaluated under each realm's rules.
Package shape
modwire_architecture.architecture— architecture maps, boundary policies, shape checks, insights, and typed reports.modwire_architecture.code— validated in-memory code-package values.modwire_architecture.layers— named layer contracts; orchestration remains to be defined.modwire_architecture.modules— named module contracts; orchestration remains to be defined.modwire_architecture.projects— project coordination contracts for modules and layers; orchestration remains to be defined.modwire_architecture.shared.config— immutable, validated configuration contracts.modwire_architecture.shared.report— architecture report contracts and metadata.
Scaffolding and glossary functionality are not part of this package. Agent composes Architecture, Mermaid, and Siren through their published interfaces.
Ecosystem
The ecosystem provides independently released building blocks:
- modwire-extraction — canonical code extraction. Follow its Trustworthy Foundation, Canonical Symbol Model v2, and Extensible Production Platform milestones.
- modwire-siren — typed Siren and OpenAPI integration. See Siren integration improvements.
- modwire-mermaid — typed, deterministic Mermaid source. See Package improvements.
Architecture depends only on Extraction. Agent composes Architecture, Mermaid, and Siren as separate published packages.
The architecture work here tracks the
Standalone Architecture Package
milestone.
Package-identity guidance is available in
Migrating from Modwire to Modwire Architecture.
The historical Modwire 4 to 5 migration remains available
for existing modwire consumers.
Model contracts
Public value objects derive from one of three Pydantic bases:
ModwireModel, ModwireConfigModel, or ModwireReportModel. They are frozen,
reject unknown fields, validate defaults, normalize surrounding string
values through domain validators, and provide dictionary, JSON, and YAML
round-trip helpers without filesystem orchestration.
Development
uv sync --all-groups
uv run pytest
uv run ruff check src tests
uv build
Metadata
Release files for modwire-architecture 7.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| modwire_architecture-7.0.0.tar.gz | 80.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| modwire_architecture-7.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 132.1 kB
Release files / modwire_architecture-7.0.0.tar.gz
| Download URL | modwire_architecture-7.0.0.tar.gz |
|---|---|
| Size | 80.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
15f31fbd8a214d039a0d8e99408f0548a27c9805f60f13c1f82317d989883fd7
|
|
BLAKE2b-256 checksum How to use checksums |
9170c8d5e3899acc0acee702392900445583a32da6c7f5b54dbf68f7a7b301b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 25, 2026.
Transparency logRelease files / modwire_architecture-7.0.0-py3-none-any.whl
| Download URL | modwire_architecture-7.0.0-py3-none-any.whl |
|---|---|
| Size | 51.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dc24deccb9ff48f5e887be6dfefbd09dd35dae8c30cc0877e15399a8f1a7c72e
|
|
BLAKE2b-256 checksum How to use checksums |
fb30ab8356df47713c168b9254260e8d8f8f91e49205a518c11c638aaa494c21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 25, 2026.
Transparency log