Datalink protocol in python
Project description
simpledali
https://img.shields.io/pypi/v/simpledali
Datalink in pure python.
Protocol is defined at https://iris-edu.github.io/libdali/datalink-protocol.html
See ringserver from IRIS for the most common datalink server instance.
Support for both regular sockets and websockets. For example:
import asyncio
import simpledali
host = "localhost"
port = 18000
uri = f"ws://{host}:{port}/datalink"
verbose = True
async def main():
verbose=False
programname="simpleDali"
username="dragrace"
processid=0
architecture="python"
dali = simpledali.SocketDataLink(host, port, verbose=verbose)
# dali = simpledali.WebSocketDataLink(uri, verbose=True)
serverId = await dali.id(programname, username, processid, architecture)
print(f"Resp: {serverId}")
await dali.close()
asyncio.run(main())
The jsonlarchive script will archive '/JSON' packets as JSONL. This is a similar function to the MSeedWrite configuration on ringserver, but in a separate process and saves JSON packets instead of miniseed.
jsonlarchive -h
usage: jsonlarchive [-h] [-v] -m MATCH -w WRITE [-d DALIHOST] [-p DALIPORT]
Archive JSON datalink packets as JSONL.
optional arguments:
-h, --help show this help message and exit
-v, --verbose increase output verbosity
-m MATCH, --match MATCH
Match regular expression pattern, ex '.*/JSON'
-w WRITE, --write WRITE
JSONL Write pattern, usage similar to MSeedWrite in
ringserver
-d DALIHOST, --dalihost DALIHOST
datalink host, defaults to localhost
-p DALIPORT, --daliport DALIPORT
datalink port, defaults to 18000
Example
There are examples of sending and receiving Datalink packets in the example directory.
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
simpledali-0.2.0.tar.gz
(22.9 kB
view hashes)
Built Distribution
simpledali-0.2.0-py3-none-any.whl
(25.3 kB
view hashes)
Close
Hashes for simpledali-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 935abc409d3dcb7f35ef504761bb35d1a1bb9080d29289f6972eae56145a0630 |
|
MD5 | ffc40822cc55baad79aaef496ba860a0 |
|
BLAKE2b-256 | 27c65e1f737a0f75b367707f4b4b7b87a5c828e626cb23ee658ebe43404df863 |