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-4.0.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

rohrpost-4.0.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rohrpost-4.0.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.17

File hashes

Hashes for rohrpost-4.0.0.tar.gz
Algorithm Hash digest
SHA256 1183f5505d96ba53c598cc0b364145dc979bc442e38f17f7d140fa06ef081051
MD5 ac5ae2f47daa44378fd67f156c3074e9
BLAKE2b-256 9f9ebdcf3a2362921f7f519896d8f080910621011f4d5d0c0861e2209869109c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rohrpost-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.17

File hashes

Hashes for rohrpost-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da4d30c7b3a0d7f2f8baf0abdfae2e019fc17bf84d6c2c33d5a7fda56522b5b9
MD5 7df4db7434393edb455f541f3790990a
BLAKE2b-256 977d6e513599d6d95bd68ba7b80de8746c9ace2f98380f0bf15b3aac3fb0c6dc

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