STMP : Sitty Talky Messaging Protocol
⚠️ Work In Progress
STMP: Sitty Talky Messaging Protocol : A primitive zero-configuration local network protocol purely written in python, originally intended for tinkering with your office mates over LAN! Created as part of my side project Sitty Talky (hence the name).
Features
- Yet another zero-configuraion protocol
- A unique peer discovery mechanism (not thaat special though!)
- Message broadcasting facility over UDP
- An end-to-end encrypted peer to peer messaging facility over TCP (I mean real end-to-end encryption)
- Support middlewares and message routing
- Support automated peer discovery
- Single threaded, the system can be clubbed with other asyncio eventloops
- STMP uses multicasting for message broadcasting and peer discovery, reducing network traffic.. (me being a responsible citizen)
Requirements
-
Python>=3.11 (As it currently uses
loop.sock_recvfrominasynciothe minimum python version requirement is 3.11, Otherwise should go with theloop.run_in_executorbased implementation, which I'm not interested in (anyway it will reduce the requirement to py3.7)) -
Internally uses Pycryptodome for rsa cryptography.
-
Unix (probably) as the system is tested only on Unix (GNU/Linux to be specific)
Installation
STMP package can be installed from PyPi using
pip install stmp-server
Or directly from github using
pip install 'stmp-server @ git+https://github.com/bRuttaZz/stmp.git'
Usage
An example use case is demonstrated bellow. (see example)
Start a listener process
from stmp import STMPServer
from stmp.interfaces import Packet, Peer
app = STMPServer()
@app.route("/test-route")
def test_route_func(packet:Packet):
print(f"Message got from {packet.headers.user}@{packet.sender} : {packet.data}")
# bind events
@app.on_peer_list_update
def peer_list_change(new_peer:Peer, removed_peers:list[Peer]):
print(f"Peer list changed : new peer -> {new_peer.user}@{new_peer.ip}" +
f" : removed peers -> {len(removed_peers)}")
if __name__=="__main__":
print(f"starting server ...")
app.run()
Send messages to it using another client over a LAN network
from stmp import STMPServer
app = STMPServer()
if __name__=="__main__":
app.broadcast("/test-route", "hi dear")
# app.send_to_peer() # work only if peers are discovered (uses TCP)
The module architecture
Metadata
Release files for stmp-server 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stmp_server-0.0.3.tar.gz | 83.7 kB | Without provenance | Details for stmp_server-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| stmp_server-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for stmp_server-0.0.3-py3-none-any.whl |
Total release size: 101.3 kB
Release files / stmp_server-0.0.3.tar.gz
| Download URL | stmp_server-0.0.3.tar.gz |
|---|---|
| Size | 83.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fb2d1c6d5a475efaf60366931b64d9d095c13fe5d2a5d1e875966bdf7b106450
|
|
BLAKE2b-256 checksum How to use checksums |
1c3e26e51a12790dd720c201b749caa2f33fcd05a603679491b117dc4a8ed963
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.11.9
|
Release files / stmp_server-0.0.3-py3-none-any.whl
| Download URL | stmp_server-0.0.3-py3-none-any.whl |
|---|---|
| Size | 17.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
952754af7064d1b4ef11b7a36a569d791911427e7370b0644794d9328ff72888
|
|
BLAKE2b-256 checksum How to use checksums |
55e72b41ec69f731a81230cd3ed0f05b3bbc06fa41cc4b32fb49c80b790ed23e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.11.9
|
Security for stmp-server 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.