Skip to main content

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
    

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiogram_di-0.1.0-py3-none-any.whl (1.4 kB view details)

Uploaded Python 3

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

Hashes for aiogram-di-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d6f04b58a1c5d034214e021134b826551cf072911509a4960d1399779dc2ae5e
MD5 9d72f494d35d44055700844ecf1c52e0
BLAKE2b-256 2dea4855bec8f15efb7ec4acd7828d15e730a7da56cbbc94fb243845fa9157bf

See more details on using hashes here.

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

Hashes for aiogram_di-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3bedd8998fbe6bb93fbad5dd4c6bc3ad390e346b0ae3f0c853cfc58c007d9d76
MD5 2cf086786d802d708e5fd2c622dd8daf
BLAKE2b-256 88887acd5d583583d9a8300504df803831dd181c8984428a89ea6ed18ed46b5f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

0.0.3

1 file

0.0.2

1 file

0.0.1

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page