py-autowired
py-autowired injects runtime dependencies into fields declared with one rule:
class UserService:
def __init__(self):
self.user_repository_instance = None
Application code contains no manual dependency-resolution calls. Register
the services once and call auto_inject() once during startup.
from py_autowired.autowired import auto_inject
from py_autowired.container import Container
container = Container()
container.register_scoped(IUserRepository, SqliteUserRepository)
container.register_transient(UserService)
auto_inject(container, root_dir="/absolute/path/to/project")
with container.create_scope():
service = UserService()
print(service.user_repository_instance)
Runtime package
The installed runtime contains only:
py_autowired/
autowired.py
container.py
Python namespace packages make __init__.py unnecessary.
Frameworks
The same core works with Console, FastAPI/ASGI, Flask/WSGI and Django. Framework
examples are under examples/; each uses domain, application, infrastructure,
composition and presentation layers without manual dependency resolution.
See KULLANIM_KILAVUZU_TR.md and USAGE_GUIDE_EN.md.
Release files for py-autowired 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| py_autowired-0.2.0.tar.gz | 27.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| py_autowired-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:42.7 kB
Release files / py_autowired-0.2.0.tar.gz
| Download URL | py_autowired-0.2.0.tar.gz |
|---|---|
| Size | 27.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6422188236885ad8a2e692b9d41937812ac7265733a477407ecff1c6d57b3934
|
|
BLAKE2b-256 checksum How to use checksums |
6f710da02815bce06bb9be294e8e08ae8d02bce443add7d9e99e250a7e99ae02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / py_autowired-0.2.0-py3-none-any.whl
| Download URL | py_autowired-0.2.0-py3-none-any.whl |
|---|---|
| Size | 15.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1f1cb6315e72f94d8a897881b459e9163bdbae480657e18c69a2395be3d93bf0
|
|
BLAKE2b-256 checksum How to use checksums |
cfcea3add105efb3799061b49c5a2570de031df0cde3ce36f28a935640c4693a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|