![]() ![]() get ( Service, default = 'something' ) # similar to a dictīy default, defines a singleton but alternative lifetimes (how long the world keeps value alive in its cache) exists such as transient where nothing is cached at all. The most common form of a dependency is an instance of a given class from antidote import injectable class Service : pass world # retrieve the instance world. Multiple ones can co-exist, but world is used by default. Some quick links:Īntidote works with a Catalog which is a sort of collection of dependencies. Tutorial, reference and more can be found in the documentation. To install Antidote, simply run this command: pip install antidote Help & Issuesįeel free to open an issue or a discussion on Github for questions, issues, proposals, etc. Everything is statically typed (mypy & pyright), documented with tested examples, can be easily used in existing code and tested in isolation. It is built on the idea of having a declarative, explicit and decentralized definitions of dependencies at the type / function / variable definition which can be easily tracked down.įeatures are built with a strong focus on maintainability, simplicity and ease of use in mind. Antidote is a dependency injection micro-framework for Python 3.7+.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |