Skip to main content

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

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-autowired 0.2.1
File Size Uploaded
py_autowired-0.2.1.tar.gz 27.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-autowired 0.2.1
File Interpreter ABI Platform
py_autowired-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size:43.1 kB

Release files / py_autowired-0.2.1.tar.gz

Download URL py_autowired-0.2.1.tar.gz
Size 27.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b26e9e509464099f8de8ce62bd0ade95ab15890dccd04f30fb2129d4bb78312b
BLAKE2b-256 checksum
How to use checksums
bdca5cb073543a1148b19fc2dceedbe519fc5f59464ff6eecbf5c68a4e7ec343
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.1-py3-none-any.whl

Download URL py_autowired-0.2.1-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da411e25e83d0082fad5d17cd01a0dcefeee44a1126ea440d383801ba0905107
BLAKE2b-256 checksum
How to use checksums
a84ea681d937bb0ff3a1bc8043e8ce7745c16f0078bc48c55c2482a45a3491f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3.0

2 release files

This release

0.2.1 This release

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page