Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

datalink-client

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+.

Installation

pip install datalink-client

Usage

Sync API

from 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))

Async API

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.

Command-line client

An interactive client is available after install:

datalink-client [host:port]

Default is localhost:16000. Use datalink-client --help for options (timeout, TLS, auth).

Releases

Packages

Contributors

Languages