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 BeanTest:
    def __init__(self, name):
        self.name = name


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

testBean = None

app = AppInitializer()
if __name__ == "__main__":
    @Autowired()
    def setTestBean(bean: BeanTest):
        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.7.tar.gz (30.9 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.7-py3-none-any.whl (38.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cndi-2.7.7.tar.gz
  • Upload date:
  • Size: 30.9 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.7.tar.gz
Algorithm Hash digest
SHA256 9df68a85432eb6d449f5a39c89908d9b52359b20f14a977f13e4bbd31d6276bc
MD5 93f7a4940c1cfcf4be9d5b75af4f7c88
BLAKE2b-256 6de2b1310bc7d7d09d849970b1541273398e9f4d56245f59a52fcbdfe5131e5f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cndi-2.7.7-py3-none-any.whl
  • Upload date:
  • Size: 38.4 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e779eb7a9f029f9acb29b2d4854a5c8b37b03844589cb257c26083239a14eb10
MD5 21bec8942a0c0a1881e18291835da0f7
BLAKE2b-256 8409ea834c1be74a22968e643bca0c778f20533e7185cc6aaef1a46169c41821

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