Propan framework: the simplest way to work with a messaging queues
Project description
Propan
Propan is a modern framework for building Applications based on Messaging Architecture.
The key features are:
- Easy: Designed to be easy to use and learn.
- Intuitive: Great editor support. Autocompletion everywhere.
- Dependencies management: Minimize code duplication. Multiple features from each argument and parameter declaration.
- MQ independent: Single and same interface to popular MQ:
- NATS
- RabbitMQ
- Greate to develop: cli tool provides great development expireince:
- framework-independent way to rule application environment
- application code hot reloading
Quickstart
Install using pip
:
$ pip install "propan[async_rabbit]"
# or
$ pip install "propan[async_nats]"
Basic usage
Create an application with the following code at serve.py
:
from propan.app import PropanApp
from propan.brokers import RabbitBroker
# from propan.brokers import NatsBroker
broker = RabbitBroker("amqp://guest:guest@localhost:5672/")
# broker = NatsBroker("nats://localhost:4222")
app = PropanApp(broker)
@broker.handle("test")
async def base_handler(body):
'''Handle all default exchange messages with `test` routing key'''
print(body)
And just run it:
$ propan run serve:app
Project template
Also propan cli is able to generate production-ready application template:
$ propan create [projectname]
Notice: project template require pydantic[dotenv]
installation.
Run created project:
# 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
To see more framework usages go to examples/
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
propan-0.0.8.0.tar.gz
(20.9 kB
view hashes)
Built Distribution
propan-0.0.8.0-py3-none-any.whl
(30.0 kB
view hashes)