Skip to content

alganet/apywire

apywire

PyPI version Python versions License CI Docs

Lazy object wiring and dependency injection for Python 3.12+

Features

  • 🚀 Lazy Loading
  • ⚡ Async Support
  • 🔒 Thread Safety
  • 📦 Code Generation
  • 📄 Naturally Configurable
  • 🎯 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.

Documentation

📚 Full DocumentationGetting StartedAPI ReferenceExamples

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

About

Lazy object wiring and dependency injection for Python 3.12+

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •