Map architecture boundaries and analyze extracted code maps.
Project description
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
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_architecture-7.0.0.tar.gz.
File metadata
- Download URL: modwire_architecture-7.0.0.tar.gz
- Upload date:
- Size: 80.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15f31fbd8a214d039a0d8e99408f0548a27c9805f60f13c1f82317d989883fd7
|
|
| MD5 |
bbea5a2e30c1eb9de1f2f88634f60882
|
|
| BLAKE2b-256 |
9170c8d5e3899acc0acee702392900445583a32da6c7f5b54dbf68f7a7b301b5
|
Provenance
The following attestation bundles were made for modwire_architecture-7.0.0.tar.gz:
Publisher:
release.yml on modwire/modwire-architecture
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modwire_architecture-7.0.0.tar.gz -
Subject digest:
15f31fbd8a214d039a0d8e99408f0548a27c9805f60f13c1f82317d989883fd7 - Sigstore transparency entry: 2246211209
- Sigstore integration time:
-
Permalink:
modwire/modwire-architecture@c1ed25b1e71c5d800450a50a72906529947268fc -
Branch / Tag:
refs/tags/v7.0.0 - Owner: https://github.com/modwire
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c1ed25b1e71c5d800450a50a72906529947268fc -
Trigger Event:
release
-
Statement type:
File details
Details for the file modwire_architecture-7.0.0-py3-none-any.whl.
File metadata
- Download URL: modwire_architecture-7.0.0-py3-none-any.whl
- Upload date:
- Size: 51.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc24deccb9ff48f5e887be6dfefbd09dd35dae8c30cc0877e15399a8f1a7c72e
|
|
| MD5 |
9d264b9208b7f1ca733d109db30f49ff
|
|
| BLAKE2b-256 |
fb30ab8356df47713c168b9254260e8d8f8f91e49205a518c11c638aaa494c21
|
Provenance
The following attestation bundles were made for modwire_architecture-7.0.0-py3-none-any.whl:
Publisher:
release.yml on modwire/modwire-architecture
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modwire_architecture-7.0.0-py3-none-any.whl -
Subject digest:
dc24deccb9ff48f5e887be6dfefbd09dd35dae8c30cc0877e15399a8f1a7c72e - Sigstore transparency entry: 2246211500
- Sigstore integration time:
-
Permalink:
modwire/modwire-architecture@c1ed25b1e71c5d800450a50a72906529947268fc -
Branch / Tag:
refs/tags/v7.0.0 - Owner: https://github.com/modwire
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c1ed25b1e71c5d800450a50a72906529947268fc -
Trigger Event:
release
-
Statement type: