Lightweight dependency injection for Python 3.13+
Project description
hdmi
Lightweight dependency injection for Python 3.13+
Warning: Pre-Alpha Software
hdmi is experimental software in active development. Breaking changes may occur until version 1.0.
Documentation: Full Docs | Getting Started | API Reference
Features
- Type-driven dependency discovery — Uses Python's standard type annotations, no decorators needed
- Scope-aware validation — Prevents lifetime bugs at container build time
- Lazy instantiation — Services created just-in-time when first resolved
- Two-phase architecture — Configuration separated from runtime for immutable, validated graphs
Quick Start
pip install hdmi
import asyncio
from hdmi import ContainerBuilder
class DatabaseConnection:
def __init__(self):
self.connected = True
class UserRepository:
def __init__(self, db: DatabaseConnection):
self.db = db
class UserService:
def __init__(self, repo: UserRepository):
self.repo = repo
async def main():
builder = ContainerBuilder()
builder.register(DatabaseConnection)
builder.register(UserRepository)
builder.register(UserService)
container = builder.build() # Validates the dependency graph
user_service = await container.get(UserService) # Auto-wired!
asyncio.run(main())
For scoped services (per-request lifecycles), transient services, and scope validation rules, see the documentation.
Development
This project follows strict TDD methodology. See CONTRIBUTING.md for details.
make test # Run all tests
make docs # Build documentation
make help # Show all available commands
License
MIT License — see LICENSE for details.
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 hdmi-0.2.4.tar.gz.
File metadata
- Download URL: hdmi-0.2.4.tar.gz
- Upload date:
- Size: 105.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8d80a5049b6cfa6f58a80eb99ad89c02a9f860326a8afe1eb28980976914036
|
|
| MD5 |
b202c441a1cbfc3719a9b29650a31fa4
|
|
| BLAKE2b-256 |
58e005e8529e7e2ff80d72bdf42f146f2b6492ecd9dd56eededd52061f78b49c
|
Provenance
The following attestation bundles were made for hdmi-0.2.4.tar.gz:
Publisher:
cicd.yml on msqd/hdmi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hdmi-0.2.4.tar.gz -
Subject digest:
f8d80a5049b6cfa6f58a80eb99ad89c02a9f860326a8afe1eb28980976914036 - Sigstore transparency entry: 925851021
- Sigstore integration time:
-
Permalink:
msqd/hdmi@d682701b9ec54dcae020f22650e8e6c3cee00157 -
Branch / Tag:
refs/tags/0.2.4 - Owner: https://github.com/msqd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cicd.yml@d682701b9ec54dcae020f22650e8e6c3cee00157 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hdmi-0.2.4-py3-none-any.whl.
File metadata
- Download URL: hdmi-0.2.4-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65642e395b3f533eb49f4ac6cad18ff45f8f8d6d728c4dfb21ad302d411dbf1d
|
|
| MD5 |
17fcfaf8627fc96e9e763f3c49812727
|
|
| BLAKE2b-256 |
773835fc317abcc3e11c8c408188660bfe7b459cb45ed23027b8e93f7aa70cd8
|
Provenance
The following attestation bundles were made for hdmi-0.2.4-py3-none-any.whl:
Publisher:
cicd.yml on msqd/hdmi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hdmi-0.2.4-py3-none-any.whl -
Subject digest:
65642e395b3f533eb49f4ac6cad18ff45f8f8d6d728c4dfb21ad302d411dbf1d - Sigstore transparency entry: 925851035
- Sigstore integration time:
-
Permalink:
msqd/hdmi@d682701b9ec54dcae020f22650e8e6c3cee00157 -
Branch / Tag:
refs/tags/0.2.4 - Owner: https://github.com/msqd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cicd.yml@d682701b9ec54dcae020f22650e8e6c3cee00157 -
Trigger Event:
push
-
Statement type: