modwire-hex
Explicit dependency-injection conventions for hexagonal Django applications, built on Wireup.
Install
pip install modwire-hex
The framework keeps the container at the composition root. Domain and application code use ordinary, type-annotated constructor dependencies.
Domain code may use DomainError for business-rule failures. It must not
contain HTTP status codes, response shapes, Django types, or DI concerns.
from modwire_hex import DomainError
class OrderCannotRequestCredit(DomainError):
pass
from modwire_hex import Containers, Module, Providers
class Payments:
def charge(self, amount: int) -> None: ...
class StripePayments(Payments):
def charge(self, amount: int) -> None:
...
class PlaceOrder:
def __init__(self, payments: Payments) -> None:
self.payments = payments
orders = Module(
"orders",
providers=[
Providers.service(PlaceOrder, None),
Providers.bind(Payments, StripePayments, "singleton", None),
],
)
container = Containers.create_sync((orders,), None)
with container.enter_scope() as scope:
place_order = scope.get(PlaceOrder)
See ADR 0001 for the architecture, conventions, and delivery sequence.
Django integration
Compose a Django process through one explicit application object:
from modwire_hex import DjangoApplication
from .orders.wiring import orders
application = DjangoApplication(modules=(orders,))
Configure the framework and its Ninja Extra API in Django settings:
INSTALLED_APPS = [
"modwire_hex.django.apps.ModwireConfig",
]
MIDDLEWARE = [
"modwire_hex.django.middleware.RequestScopeMiddleware",
]
MODWIRE = {
"APPLICATION": "myproject.wiring:application",
"NINJA": {"title": "My Project API", "version": "1.0.0"},
}
Mount the framework API once. Ninja Extra discovers controllers from installed HTTP adapter apps:
from django.urls import path
from modwire_hex.django import DjangoNinja
urlpatterns = [path("api/", DjangoNinja.api().urls)]
At an HTTP boundary, resolve only use cases from the active request scope:
from modwire_hex.django import DjangoRequest
place_order = DjangoRequest.resolve(request, PlaceOrder)
DjangoRepository is a base for outbound adapters. It centralizes generic
load and create-or-update persistence mechanics; each context repository owns
its key, lookup, record mapping, and absence semantics.
Metadata
Release files for modwire-hex 0.1.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 | Provenance | Actions |
|---|---|---|---|---|
| modwire_hex-0.1.0.tar.gz | 5.7 kB | With provenance | Details for modwire_hex-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| modwire_hex-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for modwire_hex-0.1.0-py3-none-any.whl |
Total release size: 15.1 kB
Release files / modwire_hex-0.1.0.tar.gz
| Download URL | modwire_hex-0.1.0.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d4e33a8f557916aa69dd8cef6da70fd1b4991cf680d6670cd816435917510b90
|
|
BLAKE2b-256 checksum How to use checksums |
8533e172d21bab326d2f47d8c78aca4025541c655d2d42a6cab6a089e49aff1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 19, 2026.
Transparency logRelease files / modwire_hex-0.1.0-py3-none-any.whl
| Download URL | modwire_hex-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fb39787c2ca606a6f4dc3d9488370a3b3405787e848424417c5c3cbdebb84e74
|
|
BLAKE2b-256 checksum How to use checksums |
7f0d81a1ec56d941ce65f934d6c7ee66c72012a0f4ddcc5a4497f3f046da0330
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 19, 2026.
Transparency logSecurity for modwire-hex 0.1.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for modwire_hex-0.1.0.tar.gz
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 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.