Skip to main content

rohrpost WebSocket protocol for ASGI

Project description

rohrpost is a simple WebSocket protocol that works well with Django using Channels. It will interface with every service implementing the ASGI specification (which, at the moment, is primarily Channels with Daphne).

The client implementation is rohrpost-js.

Capabilities

rohrpost specifies a very simple protocol with messages looking like this:

{
    "id": 123,
    "type": "ping",
    "data": "something",
}

This message will be handled by the ping handler (which rohrpost provides out of the box). You can add custom handlers using a method decorator. Please see our documentation for details on the protocol and handler implementation.

rohrpost also provides a mixin for Django models to push notifications on changes (create, update, delete).

Installation

From the command line:

pip install rohrpost

Or add this line to your requirements.txt:

rohrpost==3.*

Development

For development you’ll need to have the test environment installed. This is rather large since rohrpost works mainly in conjunction with Channels, Daphne, Django and so on.

pip install -r requirements/dev.txt

Run tests and style checks in this directory:

python -m pytest
python -m isort .
python -m black rohrpost tests
python -m flake8
python -m pytest --pylint --pylint-rcfile=$(pwd)/pyproject.toml --pylint-jobs=0

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

rohrpost-3.0.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

rohrpost-3.0.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file rohrpost-3.0.0.tar.gz.

File metadata

  • Download URL: rohrpost-3.0.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.6.14

File hashes

Hashes for rohrpost-3.0.0.tar.gz
Algorithm Hash digest
SHA256 8c20dd7c834f0709f41a2909ef9edb852b46e52d1637679f72f78d256a8aa713
MD5 4220fb329e20b3a256e562260b0caf76
BLAKE2b-256 a71e899d77e98f2342df62576cfb78d1008f68e9f599c43dea8339f3f0a80d22

See more details on using hashes here.

File details

Details for the file rohrpost-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: rohrpost-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.6.14

File hashes

Hashes for rohrpost-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16fd0a3e8b6d79ef9d825dd78b68a3efd26b39a118e04f47b81276af74ed5815
MD5 631528950b8e6696df9b45e98834d524
BLAKE2b-256 ad280c630f9d533c5663010bb12c8ebc08b563c18ad347df13b91ba994b66ded

See more details on using hashes here.

Supported by

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