Skip to main content

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:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

modwire_architecture-7.0.0.tar.gz (80.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

modwire_architecture-7.0.0-py3-none-any.whl (51.2 kB view details)

Uploaded Python 3

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

Hashes for modwire_architecture-7.0.0.tar.gz
Algorithm Hash digest
SHA256 15f31fbd8a214d039a0d8e99408f0548a27c9805f60f13c1f82317d989883fd7
MD5 bbea5a2e30c1eb9de1f2f88634f60882
BLAKE2b-256 9170c8d5e3899acc0acee702392900445583a32da6c7f5b54dbf68f7a7b301b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for modwire_architecture-7.0.0.tar.gz:

Publisher: release.yml on modwire/modwire-architecture

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file modwire_architecture-7.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for modwire_architecture-7.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc24deccb9ff48f5e887be6dfefbd09dd35dae8c30cc0877e15399a8f1a7c72e
MD5 9d264b9208b7f1ca733d109db30f49ff
BLAKE2b-256 fb30ab8356df47713c168b9254260e8d8f8f91e49205a518c11c638aaa494c21

See more details on using hashes here.

Provenance

The following attestation bundles were made for modwire_architecture-7.0.0-py3-none-any.whl:

Publisher: release.yml on modwire/modwire-architecture

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page