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
Release history Release notifications | RSS feed
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.0.tar.gz
(6.1 kB
view details)
Built Distribution
File details
Details for the file pydiatr-0.1.0.tar.gz
.
File metadata
- Download URL: pydiatr-0.1.0.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c9b9c8b78f1e03e30c0879401915ed674218811633dfdadd64bca097302b2c0 |
|
MD5 | 24025156106b8f50a6e59995fdad4e07 |
|
BLAKE2b-256 | f48e52cccd0b859c511157ac02da5d46504191ed6b4598cee8ca3cebe5cbf702 |
File details
Details for the file pydiatr-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: pydiatr-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.2 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1259d00715b73f23b060d3dcfc1986db91b0ad97597dea06875aaba318f4eac1 |
|
MD5 | 152c1ecb088db4a6ee77bafdf34ab1b8 |
|
BLAKE2b-256 | 9fbea9fdaf805aeaee7f25594b18540579f8c5a19a061ef4c7a8ea7de8e1f0ca |