Skip to main content

Python library for easy message broker handling using Pydantic

Project description

pikantic

PyPI PyPI - Python Version PyPI License Code Style: black

Python library for easy message broker handling using Pydantic

Basic Usage

import pikantic
from pydantic import BaseModel

app = pikantic.Pikantic(AMQP_URI)


class PersonModel(BaseModel):
    name: str
    age: int


@app.on_rabbit('test_queue')
async def handle_message(msg: aio_pika.Message, person: PersonModel):
    print(msg.body)
    print(person.age)


if __name__ == '__main__':
    app.run()

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

pikantic-0.1.2.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

pikantic-0.1.2-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

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