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 pylint --recursive=y --reports=y --verbose ./
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rohrpost-4.1.0.tar.gz
.
File metadata
- Download URL: rohrpost-4.1.0.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bf9b5cd6ea3d64f104e2ae763299c28b3ba401b463256bcf38fc3cfa3052c51 |
|
MD5 | 5c9c5b3246d0ae52e19b48b0f382767e |
|
BLAKE2b-256 | bb6c291b44b10f065711e06e1f1ea03996ebca24c93b91a440637c7a76579a1e |
File details
Details for the file rohrpost-4.1.0-py3-none-any.whl
.
File metadata
- Download URL: rohrpost-4.1.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 498e55600be1938aa8014a0103c880c01e8e427e88d03b97085805a800385404 |
|
MD5 | e3632c97cab8d3dea6071c065da53686 |
|
BLAKE2b-256 | 1a8ae8c7bfdd60aa1a14b4c3050293828d12180732a4b92667a559f4fa419a13 |