Skip to content

FrankPudding/morphine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to morphine's documentation

What is morphine?

Morphine is a container based dependency injection framework for Python. Morphine was built from scratch to have most of the features from Dependency Injector since they have stopped updating their package.

Features

Providers

Providers are callable objects that are able to provide dependencies. When you want your dependency, you call the provider to provide it for you.

Factory

The Factory provider will provide a new instance every time it is called.

Singleton

The Singleton provider will create a new instance the first time it is called and return that same object for subsequent calls.

Resource

The Resource provider is similar to a singleton in that calling it always returns the same instance. The difference being that resources have a startup and a shutdown method. For global configurations, the startup method may not return anything.

Configuration

Similar to a provider, a Configuration is also a callable. When you call it, it will provide your config as a dictionary. Calling its members will provide the values of those configurations.

Container

A container is a collection of Providers and Configurations. You can inherit from the Container class to define your dependencies and then instantiate your class to retrieve your Providers.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages