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
Release history Release notifications | RSS feed
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.4.9.tar.gz
(26.7 kB
view details)
Built Distribution
cndi-2.4.9-py3-none-any.whl
(35.2 kB
view details)
File details
Details for the file cndi-2.4.9.tar.gz
.
File metadata
- Download URL: cndi-2.4.9.tar.gz
- Upload date:
- Size: 26.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ee7c1982b79d1bfef2206449e4e4df243e89c9b421fa395dcef06f8a3eef433 |
|
MD5 | 5ebfa867835b176a3b1766a8ed635d24 |
|
BLAKE2b-256 | 78c264ed8596127ed77e743dda8363adb60f6ed7ac405b99d08962a580d5ad79 |
File details
Details for the file cndi-2.4.9-py3-none-any.whl
.
File metadata
- Download URL: cndi-2.4.9-py3-none-any.whl
- Upload date:
- Size: 35.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 317a57cc77c120ce31fd00d66bc725e2a5098eb82b2de6be76f1a6c71665c43b |
|
MD5 | 4720b408c5cab1befe5944ff0f6e0b7a |
|
BLAKE2b-256 | a41bb44f357d660110ec5c5a2efd5ecf854a385fa9059d6ccfff015003563b35 |