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.7.1.tar.gz (30.7 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.1-py3-none-any.whl (40.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cndi-2.7.1.tar.gz
  • Upload date:
  • Size: 30.7 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.1.tar.gz
Algorithm Hash digest
SHA256 e9f83eef3a2f952aca88e04f4aa46cd9684ef16893e81ae40e02542bda50c9b9
MD5 31c5b5b2e366afefb82c18b611cb9cfe
BLAKE2b-256 684d44e8c31daf0545e1f1080305efa96454501ba3470281e3c30d4b55ed8b08

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cndi-2.7.1-py3-none-any.whl
  • Upload date:
  • Size: 40.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 85d5cffc190503049756ee0f3f0a0c0f7aa7b243d62a573e92eab6aa0eceee55
MD5 9fbbe45ac34e3277717ec4cc4642eb0e
BLAKE2b-256 0e1aae4fb64c9d343bc272dc9d7184a35ddd93edcd92b72d791ee2060a3d4999

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