https://github.com/alganet/apywire
Lazy object wiring and dependency injection for Python 3.12+
https://github.com/alganet/apywire
asyncio configuration-management dependency-injection lazy-loading python thread-safe
Last synced: 3 months ago
JSON representation
Lazy object wiring and dependency injection for Python 3.12+
- Host: GitHub
- URL: https://github.com/alganet/apywire
- Owner: alganet
- License: isc
- Created: 2025-11-19T02:24:36.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2026-03-26T01:14:12.000Z (3 months ago)
- Last Synced: 2026-03-26T22:51:20.822Z (3 months ago)
- Topics: asyncio, configuration-management, dependency-injection, lazy-loading, python, thread-safe
- Language: Python
- Homepage: https://alganet.github.io/apywire/
- Size: 1.71 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
# apywire
[](https://pypi.org/project/apywire/)
[](https://pypi.org/project/apywire/)
[](https://github.com/alganet/apywire/blob/main/LICENSE)
[](https://github.com/alganet/apywire/actions/workflows/ci.yml)
[](https://alganet.github.io/apywire/)
Lazy object wiring and dependency injection for Python 3.12+
## Features
- 🚀 Lazy Loading
- âš¡ Async Support
- 🔒 Thread Safety
- 📦 Code Generation
- 📄 Naturally Configurable
- 🎯 Zero Dependencies
## Installation
```bash
uv pip install apywire
```
## Quick Example
```python
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](docs/user-guide/configuration-files.md), apywire doesn't care.
## Documentation
📚 **[Full Documentation](docs/index.md)** • [Getting Started](docs/getting-started.md) • [API Reference](docs/api-reference.md) • [Examples](docs/examples.md)
Build docs locally:
```bash
make docs-serve # http://127.0.0.1:8000
```
## Development
```bash
uv sync --extra dev # Setup
make all # Format, lint, test, build
```
See [docs/development.md](docs/development.md) for guidelines.
## License
ISC License - see [LICENSES/ISC.txt](LICENSES/ISC.txt)