Skip to main content

Alem Mela

Overview

Asynchronous framework that makes it really simple to build RabbitMQ services.

Installation

pip install mela

Usage

Basic usage does look like this:

app.py:

from pydantic import BaseModel
from datetime import datetime

from mela import Mela

app = Mela(__name__)


class Document(BaseModel):
    text: str
    url: str
    date: datetime


@app.service('printer')
def printer(body: Document) -> Document:
    print(body)
    return body


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

application.yml:

connections:
  default:
    host: localhost
    port: 5672
    username: user
    password: bitnami

services:
  printer:
    consumer:
      exchange: general-sentiment-x
      routing_key: general-sentiment-q
      queue: general-sentiment-q
    publisher:
      exchange: general-sentiment-x
      routing_key: general-sentiment-q

For more use cases check /examples directory.

Contribute

Clone this repo, create virtualenv using make setup command.

NOTE: If you use PyCharm - don't let it create its own virtualenv.

Run tests using make test

Run linter using make lint

Run mypy using make type

Feel free to create issues.

Feel free to contribute.

Feel free to add yourself to Authors block in this document.

You also can join our Telegram chat.

Despite major version, there is a lot of work undone. You can check TODO section in changelog to find an interesting task for you or check issues section of this repository.

Contributors

Developed in Alem Research.

Core maintainer: Daniyar Supiyev (undead.thunderbird@gmail.com).

Sponsor: Sergazy Narynov.

Release files for mela 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mela 1.1.1
File Size Uploaded
mela-1.1.1.tar.gz 19.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mela 1.1.1
File Interpreter ABI Platform
mela-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 44.5 kB

Release files / mela-1.1.1.tar.gz

Download URL mela-1.1.1.tar.gz
Size 19.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d68f805bbe185165c0c7ad725baedac2bc6c602e1e57abb2f5b81e798251f336
BLAKE2b-256 checksum
How to use checksums
d3ad132ba77bd5f44f7608f861d6ebf54a1ad764025a7dcf125730149276dd05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release files / mela-1.1.1-py3-none-any.whl

Download URL mela-1.1.1-py3-none-any.whl
Size 25.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4595ab829e86796c738fa01a85fc42f799c24e2c3afba03f07c3eb6209757768
BLAKE2b-256 checksum
How to use checksums
b8dbd8f0904880ace421f54dfe42e97e989b51a10627bc80c228c5bd8f5df5fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page