DataLink protocol client for reading and writing data using the DataLink protocol. DataLink is a simple, packet-based streaming protocol used in seismological data systems, primarily with EarthScope's ringserver software.
Requires Python 3.11+.
pip install datalink-clientfrom datalink_client import DataLink
with DataLink("localhost", 16000) as dl:
dl.match("FDSN:IU_COLA_.*")
dl.stream()
for packet in dl.collect():
print(packet.streamid, len(packet.data))AsyncDataLink offers the same commands as DataLink, as coroutines, built on asyncio:
import asyncio
from datalink_client import AsyncDataLink
async def main():
async with AsyncDataLink("localhost", 16000) as dl:
await dl.match("FDSN:IU_COLA_.*")
await dl.stream()
async for packet in dl.collect():
print(packet.streamid, len(packet.data))
asyncio.run(main())The simpledali package is another option for async/await support.
An interactive client is available after install:
datalink-client [host:port]Default is localhost:16000. Use datalink-client --help for options (timeout, TLS, auth).