Lazy object wiring and dependency injection for Python 3.12+
- 🚀 Lazy Loading
- ⚡ Async Support
- 🔒 Thread Safety
- 📦 Code Generation
- 📄 Naturally Configurable
- 🎯 Zero Dependencies
uv pip install apywirefrom 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 + cachingspec is a plain dictionary. It can be written in Python, or come from a
config file, apywire doesn't care.
📚 Full Documentation • Getting Started • API Reference • Examples
Build docs locally:
make docs-serve # http://127.0.0.1:8000uv sync --extra dev # Setup
make all # Format, lint, test, buildSee docs/development.md for guidelines.
ISC License - see LICENSES/ISC.txt