Skip to main content

Automated dependency injection for Python

Project description

Autoinject

Documentation Status

A clean, simple type-safe framework for using the Dependency Injection pattern in Python.

Example

from autoinject import injector, auto

@injector.injectable
class MyService:
    def __init__(self): ...
    

class MyClient:
  
  service: MyService
  
  @injector.construct
  def __init__(self):
    # self.service will be set before this function is called
    ...
  
@injector.inject
def my_client_function(service: MyService = auto()):
    # service will be set before this function is called
    ...

Read the full documentation for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autoinject-2.0.0.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autoinject-2.0.0-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file autoinject-2.0.0.tar.gz.

File metadata

  • Download URL: autoinject-2.0.0.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for autoinject-2.0.0.tar.gz
Algorithm Hash digest
SHA256 5c1bddcc4f51eb0d6df7b1291defe25b3a8e8b919bcbf28919793ff74ae6b57c
MD5 21089062faee7f85aea09575455d9f8e
BLAKE2b-256 2a5fff3e32828983da3c9bbbd904cd8e5eca0114800fc29e37cb0a63ef818734

See more details on using hashes here.

File details

Details for the file autoinject-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: autoinject-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for autoinject-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 718e10f5dbddbbd7a361dc7687189e8be246a8b204e3ee80b752812e6aa39e2d
MD5 f36e20a5b659f262672821eca666b5cd
BLAKE2b-256 9ff554e46a00264b656bab627f340ab16c3423b321ba5e8394b185f23c15a767

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page