Skip to main content

pre-commit Code style: black Imports: isort Checked with mypy security: bandit Upload Python Package Coverage Status Documentation Status PyPI version

Introduction

This library is a port of Mediatr in Python.

For more information and usage instructions, see the documentation.

Usage

pip install mediatpy

import asyncio

from mediatpy import Request, RequestHandler, Mediator


class MyResponse:
    pass


class MyRequest(Request[MyResponse]):
    pass


mediator = Mediator()


@mediator.request_handler
class MyRequestHandler(RequestHandler[MyRequest, MyResponse]):
    async def handle(self, request: MyRequest) -> MyResponse:
        return MyResponse()


async def main():
    request = MyRequest()
    response = await mediator.send(request)
    assert isinstance(response, MyResponse)


if __name__ == '__main__':
    asyncio.run(main())

Metadata

Release files for mediatpy 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mediatpy 0.2.1
File Size Uploaded Provenance Actions
mediatpy-0.2.1.tar.gz 4.7 kB Without provenance Details for mediatpy-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mediatpy 0.2.1
File Interpreter ABI Platform Actions
mediatpy-0.2.1-py3-none-any.whl Python 3 none any Details for mediatpy-0.2.1-py3-none-any.whl

Total release size: 9.0 kB

Release files / mediatpy-0.2.1.tar.gz

Download URL mediatpy-0.2.1.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f926643849abcac54b07dc8f33c95a4d41fcd705aec80d6d11c70325ddf9d4c7
BLAKE2b-256 checksum
How to use checksums
e27fc0b1c19ac3f53b5f897e5f8176679ec12ba0ba518531bf1e0cf98068ac42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.0 CPython/3.10.8 Linux/5.15.0-1024-azure

Release files / mediatpy-0.2.1-py3-none-any.whl

Download URL mediatpy-0.2.1-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e88a8d04d77f49dc2839963b9cadad8868837fdad1bb547639cb54fffac41bc
BLAKE2b-256 checksum
How to use checksums
069e679605a76a0fcf769b37ef1774f620cce0b650d50bea907097ba2e6e11ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.0 CPython/3.10.8 Linux/5.15.0-1024-azure

Security for mediatpy 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page