Skip to main content

A minimal and reliable JSON MQ library!

Project description

MIT License TODOs

uMQ logo

uMQ: A minimal and reliable JSON MQ library!

uMQ is a minimal package derived from my main research project to achieve reliable and fast JSON communication.

The story:

I'm developing a full-fledged hardware+software product as my research project and I needed to instanciate IPC communication between two(or several) python processes. After looking around, found packages with extreme capabilities. 0MQ(https://zeromq.org/) and RabbitMQ are just a couple of examples. My specific application didn't need to use all those features and I didn't see the necessity of going through their steep lurning curves so I decided to write my own code.

As a hardware engineer, I deal with state machines all the time. I have used state machines in this code to reliably convert bytes to JSON packets.

Development:

My goal is to keep this packege easy to use. You only need to learn one class and three functions to start a JSON communication. My main focus is currently to fix bugs and improve the performance.

Please feel free to contribute, add features or request them.

Usage

Installing

To install the package you can simply do:

$ pip install uMQ

Starting the communication

On the server side, run:

    uMQIntance = uMQ_Socket()
    uMQIntance.server("localhost", 5008)
    while (True):
        uMQIntance.hold()
        while (uMQIntance.data_available()):
            data = uMQIntance.get_next_pkt()
            ## do something with the data
        uMQIntance.Clear()

This will create a uMQ_Socket which is listening on localhost and port 5008.

on the client side do:

    data = {"Sample Data": "DEADBEEF"}
    uMQIntance = uMQ_Socket()
    uMQIntance.connect("localhost", 5008)
    uMQIntance.send_all (json.dumps(data))

For the complete test scripts. Refer to the "tests" directory.

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

uMQ-1.0.2.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uMQ-1.0.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file uMQ-1.0.2.tar.gz.

File metadata

  • Download URL: uMQ-1.0.2.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for uMQ-1.0.2.tar.gz
Algorithm Hash digest
SHA256 c4cb7671d6fb2e38b68175ea43e0347aabce06aaddbfb2f8b324cfa675065b3b
MD5 c0b66f14a25759304a5ed84398930d69
BLAKE2b-256 6f2ea113760b5e413f1334bbe93884ff406d4f2c483fefdd196ca2a689201744

See more details on using hashes here.

File details

Details for the file uMQ-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: uMQ-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for uMQ-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6e2355b23c8bee21bce1a59c8a62ac25e45bcdb3ba2adadaa5b5f9b1d4b0e141
MD5 c54eda846febccf5ea3ccf2be4012a63
BLAKE2b-256 79c10814412cd3c58c6652287acb1933123d81edffcdce78fc58355ef6eb590f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page