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-0.1.0.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-0.1.0-py3-none-any.whl (39.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cndi-0.1.0.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-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a21ec74073f26435ca5fbea732db571ac20cb856ea864eae23c1313ef19a9132
MD5 d5f0d5857baa8a33fefa3a3252c2aa78
BLAKE2b-256 3c3779c263814f951b35d5804aaee16aca84d7df247f68369ae0c08350c77bba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cndi-0.1.0-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-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 695cf95c43159a83e6eeb2affa8655dd6ac88ec1c0e965cca5e3187f8ef74186
MD5 b74491dac81b558a3111dd63a3a36560
BLAKE2b-256 a2d42d60d5cac24fc8441b50ad0e7a07e558cefa5dd44a123d44f03b279e432e

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