Skip to main content

No project description provided

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.6.0.tar.gz (30.6 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.6.0-py3-none-any.whl (40.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cndi-2.6.0.tar.gz
Algorithm Hash digest
SHA256 0e44b048a91fa26d3a8d255a0ab36cc37d54d173cab98350abbb4e88f8a474e8
MD5 2dc5af90a3e1239302cbf77be5c3ce6f
BLAKE2b-256 ec9dc769dff7553cf17a8f115311591cbb8b34159878c0c242f48f67f579293c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cndi-2.6.0-py3-none-any.whl
  • Upload date:
  • Size: 40.7 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.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a46df989adb20491ad4ffade52d62ae490dbcc3f997aadcddc82e6632eda1f6
MD5 b6945ae2d4c0f38ea1cd39e61b033794
BLAKE2b-256 3a412e2058b221f7f5bfe006773b78e0c4efced1da91d8b1a28e69bce20777d8

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