Skip to content

alganet/apywire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

56 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

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 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

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

  •  
  •