Skip to main content

Simple and fast framework to create message brokers based microservices

Project description

Package version downloads Supported Python versions

Quickstart

Install using pip:

$ pip install "propan[async_rabbit]"

Basic usage

Create an application, in example.py:

from propan.app import PropanApp
from propan.brokers import RabbitBroker


broker = RabbitBroker("amqp://guest:guest@localhost:5672/")

app = PropanApp(broker)


@broker.handle("test")
async def base_handler(body: dict):
    '''Handle all default exchange messages with `test` routing key'''
    print(body)

Run the application:

$ propan run example:app --reload

Project template

Project template require pydantic[dotenv] installation.

To create project template use:

$ propan create [projectname]

To run created project use:

# Run rabbimq first
$ docker compose --file [projectname]/docker-compose.yaml up -d

# Run project
$ propan run [projectname].app.serve:app --env=.env --reload

Now you can enjoy a new development experience!

Examples

Too see more use cases go to examples/

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

propan-0.0.7.6.tar.gz (16.9 kB view hashes)

Uploaded Source

Built Distribution

propan-0.0.7.6-py3-none-any.whl (24.4 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