https://github.com/tomgrin10/pikantic
Python library for easy message broker handling using Pydantic
https://github.com/tomgrin10/pikantic
python python3 rabbitmq
Last synced: 4 months ago
JSON representation
Python library for easy message broker handling using Pydantic
- Host: GitHub
- URL: https://github.com/tomgrin10/pikantic
- Owner: tomgrin10
- License: mit
- Created: 2021-06-26T20:59:01.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-07-10T15:20:15.000Z (about 4 years ago)
- Last Synced: 2025-01-27T03:15:18.816Z (6 months ago)
- Topics: python, python3, rabbitmq
- Language: Python
- Homepage:
- Size: 16.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pikantic
[](https://pypi.org/project/pikantic/)
[](https://pypi.org/project/pikantic/)
[](https://pypi.org/project/pikantic/)
[](https://github.com/psf/black/)Python library for easy message broker handling using Pydantic
### Basic Usage
```python
from pikantic import Pikantic, IncomingMessage
from pydantic import BaseModelapp = Pikantic(AMQP_URI)
class PersonModel(BaseModel):
name: str
age: int@app.on_rabbit('test_queue')
async def handle_message(msg: IncomingMessage, person: PersonModel):
print(msg.body)
print(person.age)if __name__ == '__main__':
app.run()
```