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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: rohrpost-3.1.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15

File hashes

Hashes for rohrpost-3.1.0.tar.gz
Algorithm Hash digest
SHA256 9cd42567c6baa0df39cf7051452f9a461055e9087db31544e4bb2dd9907fde7e
MD5 5c12707d60e91d210e4e77513f1e1a4d
BLAKE2b-256 d669900ba6963410bb28c484ea0789f560724921b80eaae7abb2c6811f4efb02

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rohrpost-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15

File hashes

Hashes for rohrpost-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f72cc7d56c5709dbcd694be6b7230fff7a42520ba6218602dcbb73a480e1ffa
MD5 cbdff61a4c4cf558638f742b65b521f6
BLAKE2b-256 c0b97a6ae32ba13febeb7bdd30bb7a9360cfeee9523b1c1b56e2d38cf56398ff

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