Skip to main content

Add your description here

Project description

Install

pip install -U git+https://github.com/mayank31313/python-dependency-injection.git

Documentation

Documentation is shifted here

Example

Follow the below code to simplify understanding, or can also refer to main.py

from cndi.annotations import Bean, Autowired, AppInitializer

class TestBean:
    def __init__(self, name):
        self.name = name


@Bean()
def getTestBean() -> TestBean:
    return TestBean("Test 123")

testBean = None

app = AppInitializer()
if __name__ == "__main__":
    @Autowired()
    def setTestBean(bean: TestBean):
        global testBean
        testBean = bean

    app.run()

    print(testBean.name)

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

cndi-2.7.2.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

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

cndi-2.7.2-py3-none-any.whl (39.3 kB view details)

Uploaded Python 3

File details

Details for the file cndi-2.7.2.tar.gz.

File metadata

  • Download URL: cndi-2.7.2.tar.gz
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for cndi-2.7.2.tar.gz
Algorithm Hash digest
SHA256 de82867523cb9232f600604df54ccb7f7ae1a09979d2aa22276987e183e37888
MD5 ed58a6db345c9445de62e16f96f3706e
BLAKE2b-256 9784f3b813476e78d90eb2ce6b8456d2fa87f135166f3f3c3820c64f365b3e05

See more details on using hashes here.

File details

Details for the file cndi-2.7.2-py3-none-any.whl.

File metadata

  • Download URL: cndi-2.7.2-py3-none-any.whl
  • Upload date:
  • Size: 39.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for cndi-2.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 49f9fe1a04153a1d41b18470eb227486b5164d681b9d98a3efcfbc775d14169f
MD5 dffad06e04ada24dae92d43f2bedb110
BLAKE2b-256 50238e10e62332ebc750885e4ce94c76df7e706755340ad56b362956686b819a

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