No project description provided
Project description
Aiogram DI
Installation
-
Latest version from GitHub
pip install git+https://github.com/MaximZayats/aiogram-di
-
From PyPi
pip install -U aiogram-di
Usage
-
Initialization
from aiogram_di import DIMiddleware @dataclass class A: id: int dp.message.middleware( DIMiddleware( { A: lambda: A(id=1), } ) )
-
Usage
@dp.message() async def handler( message: Message, a: A, # <- will be injected ) -> None: assert a.id == 1
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
aiogram-di-0.0.3.tar.gz
(1.9 kB
view hashes)