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?
Metadata
Release files for pydiatr 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pydiatr-0.1.0.tar.gz | 6.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pydiatr-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.4 kB
Release files / pydiatr-0.1.0.tar.gz
| Download URL | pydiatr-0.1.0.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3c9b9c8b78f1e03e30c0879401915ed674218811633dfdadd64bca097302b2c0
|
|
BLAKE2b-256 checksum How to use checksums |
f48e52cccd0b859c511157ac02da5d46504191ed6b4598cee8ca3cebe5cbf702
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.11.10 Linux/6.8.0-1014-azure
|
Release files / pydiatr-0.1.0-py3-none-any.whl
| Download URL | pydiatr-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1259d00715b73f23b060d3dcfc1986db91b0ad97597dea06875aaba318f4eac1
|
|
BLAKE2b-256 checksum How to use checksums |
9fbea9fdaf805aeaee7f25594b18540579f8c5a19a061ef4c7a8ea7de8e1f0ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.11.10 Linux/6.8.0-1014-azure
|