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.3.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.3.0.tar.gz | 29.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| py_autowired-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:45.3 kB
Release files / py_autowired-0.3.0.tar.gz
| Download URL | py_autowired-0.3.0.tar.gz |
|---|---|
| Size | 29.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9aaf9a8dd1e0b42f19391ada226d46a5702b306a830f9647c3b79bd1a42ece6c
|
|
BLAKE2b-256 checksum How to use checksums |
c470928938d5e70ebef5a0288f811660cd18222fb52fc8220811383f824ce4bf
|
| 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.3.0-py3-none-any.whl
| Download URL | py_autowired-0.3.0-py3-none-any.whl |
|---|---|
| Size | 16.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a0355d3268788bf43a8558117dd552b16aa64653b16eb1381b98d58b0ecfe370
|
|
BLAKE2b-256 checksum How to use checksums |
1b2cfbedb770a7d059f95e36f0205dfb35146f7255768b408509da3414fb0890
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|