Metadata-Version: 2.1
Name: fastdependency
Version: 0.1.0
Summary: Dependency Injection Library
Home-page: https://github.com/mahs4d/fastdependency
License: MIT
Author: Mahdi Sadeghi
Author-email: mahdi74sadeghi@gmail.com
Requires-Python: >=3.12,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Project-URL: Repository, https://github.com/mahs4d/fastdependency
Description-Content-Type: text/markdown

# Fast Dependency

## Installation

`pip install fastdependency`

## Usage

```python
from fastdependency import Container, Depends


# Define your default global container class.
class MyContainer(Container):
    def lock_password(self) -> str:
        return "123**456"


# Create an instance of your container and set it as default.
Container.set_default_container(MyContainer())


def username() -> str:
    return 'mahdi'


def my_function(
        param: int,
        username=Depends(username),  # Gets it from function.
        password=Depends('lock_password'),  # Gets it from container.
):
    print(param)
    print(username)
    print(password)


my_function(12)
```


