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 details)
Built Distribution
File details
Details for the file aiogram-di-0.1.0.tar.gz
.
File metadata
- Download URL: aiogram-di-0.1.0.tar.gz
- Upload date:
- Size: 1.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6f04b58a1c5d034214e021134b826551cf072911509a4960d1399779dc2ae5e |
|
MD5 | 9d72f494d35d44055700844ecf1c52e0 |
|
BLAKE2b-256 | 2dea4855bec8f15efb7ec4acd7828d15e730a7da56cbbc94fb243845fa9157bf |
File details
Details for the file aiogram_di-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: aiogram_di-0.1.0-py3-none-any.whl
- Upload date:
- Size: 1.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bedd8998fbe6bb93fbad5dd4c6bc3ad390e346b0ae3f0c853cfc58c007d9d76 |
|
MD5 | 2cf086786d802d708e5fd2c622dd8daf |
|
BLAKE2b-256 | 88887acd5d583583d9a8300504df803831dd181c8984428a89ea6ed18ed46b5f |