apywire
Lazy object wiring and dependency injection for Python 3.12+
Features
- 🚀 Lazy Loading
- ⚡ Async Support
- 🔒 Thread Safety
- 📦 Code Generation
- 📄 Naturally Configurable
- 🧩 Overlayable
- 🎯 Zero Dependencies
Installation
uv pip install apywire
Quick Example
from apywire import Wiring
spec = {
"datetime.datetime now": {"year": 2025, "month": 1, "day": 1},
"MyService service": {"start_time": "{now}"}, # Dependency injection
}
wired = Wiring(spec)
service = wired.service() # Lazy instantiation + caching
spec is a plain dictionary. It can be written in Python, or come from a
config file, apywire doesn't care.
Specs overlay, so a library can ship defaults and a user's config can extend them instead of restating them:
from apywire import Wiring, merge_specs
defaults = {"myapp.Registry registry": {"repos": ["{builtin}"]}}
user = {"registry": {"+repos": ["{my_repo}"]}} # append, don't replace
wired = Wiring(merge_specs(defaults, user))
Documentation
📚 Full Documentation • Getting Started • API Reference • Examples
Build docs locally:
make docs-serve # http://127.0.0.1:8000
Development
uv sync --extra dev # Setup
make all # Format, lint, test, build
See docs/development.md for guidelines.
License
ISC License - see LICENSES/ISC.txt
Metadata
Release files for apywire 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| apywire-1.1.1.tar.gz | 245.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| apywire-1.1.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.17+ x86-64 | Details |
Total release size: 1.1 MB
Release files / apywire-1.1.1.tar.gz
| Download URL | apywire-1.1.1.tar.gz |
|---|---|
| Size | 245.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55bfd633bbe489f73a9ea1d76ce3487d8f06b0d9fccdd282a2e82daf3509a908
|
|
BLAKE2b-256 checksum How to use checksums |
86aa9c7476bff24fb13e0b07f618710e34a3175cdafb640458735e40a11b4198
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|
Release files / apywire-1.1.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | apywire-1.1.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 845.1 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
cf1e859abf75a917e157080a0616dff48d5b074e9a7ab1c07752a6293cce277f
|
|
BLAKE2b-256 checksum How to use checksums |
b5d434cf09f5fd7d9a7838d1ec30a57e7e98ce1af58c8d99b1dc9e1b0fcd0832
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|