Skip to main content

No project description provided

Project description

PydiatR

The python MediatR.

Example Usage

from pydiatr.handler import AbstractHandler, AbstractRequest, AbstractResponse
from pydiatr.registry import Registry

registry = Registry()

class CreateUserRequest(AbstractRequest):
    username: str
    email: str

class CreateUserResponse(AbstractResponse):
    success: bool

@registry.decorate_handler
class CreateUserHandler(AbstractHandler[CreateUserRequest, CreateUserResponse]):

    async def handle(self, request: CreateUserRequest) -> CreateUserResponse:
        print(f"Creating user: {request.username} with email: {request.email}")
        return CreateUserResponse(success=True)

response = await registry.dispatch(CreateUserRequest)

TODO:

  • Abstract/DRY CI/CD
  • Auto version bumping in CI/CD based on commit message using poetry version <option>
  • Tests
  • Test coverage and coverage comment on PR
  • Coverage badge
  • build badge
  • license badge
  • pypi badge
  • README
  • FastAPI example
  • FastAPI cookiecutter?

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

pydiatr-0.1.1a0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

pydiatr-0.1.1a0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file pydiatr-0.1.1a0.tar.gz.

File metadata

  • Download URL: pydiatr-0.1.1a0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.10 Linux/6.8.0-1014-azure

File hashes

Hashes for pydiatr-0.1.1a0.tar.gz
Algorithm Hash digest
SHA256 953bea017b6edd19e0c7ea458806cf275f96cb71911ce1972318a196ef8b2e76
MD5 00c6294ceac9a87b8ae0895da699ae0f
BLAKE2b-256 6e96a024cc64211dc6500e12858343685e7bb95aaa868486ddf615c45afbe4a2

See more details on using hashes here.

File details

Details for the file pydiatr-0.1.1a0-py3-none-any.whl.

File metadata

  • Download URL: pydiatr-0.1.1a0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.10 Linux/6.8.0-1014-azure

File hashes

Hashes for pydiatr-0.1.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 687b5b7ed802fe77888c00c2619fe87c63adc9ae281bf020fec0261fe5ec2ce8
MD5 16f09edc7fdce4e4e322ea9d067eaa6c
BLAKE2b-256 5579a76745512f3239211385e706351f6bf8c796d8b62bcd7df41b14fa82cefa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page