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.1.0.tar.gz
(1.9 kB
view hashes)
Built Distribution
Close
Hashes for aiogram_di-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bedd8998fbe6bb93fbad5dd4c6bc3ad390e346b0ae3f0c853cfc58c007d9d76 |
|
MD5 | 2cf086786d802d708e5fd2c622dd8daf |
|
BLAKE2b-256 | 88887acd5d583583d9a8300504df803831dd181c8984428a89ea6ed18ed46b5f |