Skip to main content

seedlink-client

SeedLink protocol client for streaming geophysical (seismic) data, with transparent support for both SeedLink 3.x and 4.0. SeedLink is a real-time streaming protocol used by seismological data systems (e.g. SeisComP, EarthScope's ringserver) to deliver miniSEED data as it is recorded.

Requires Python 3.11+.

Installation

pip install seedlink-client

Usage

Sync API

from seedlink_client import SeedLink

with SeedLink("rtserve.earthscope.org") as sl:
    sl.add_stream("IU_COLA", "BH?")
    for packet in sl.collect():
        print(packet.station_id, packet.seqnum, len(packet.payload))

Async API

AsyncSeedLink offers the same API as SeedLink, built on asyncio. Only the methods that do network I/O (connect, collect, info, ...) are coroutines; stream selection (add_stream and friends) is plain configuration and stays synchronous on both clients:

import asyncio
from seedlink_client import AsyncSeedLink

async def main():
    async with AsyncSeedLink("rtserve.earthscope.org") as sl:
        sl.add_stream("IU_COLA", "BH?")
        async for packet in sl.collect():
            print(packet.station_id, packet.seqnum, len(packet.payload))

asyncio.run(main())

Protocol versions

SeedLink/AsyncSeedLink negotiate SeedLink 3.x or 4.0 automatically from the server's HELLO reply and speak whichever is offered -- selectors, sequence numbers, time windows, and INFO queries all work the same way from the caller's side regardless of which protocol is in use. Pass protocol=Protocol.V3 or Protocol.V4 to pin a version instead of negotiating.

Packets carry their payload as raw bytes; call packet.record() to decode it as a pymseed MS3Record.

Command-line client

A non-interactive client is available after install:

seedlink-client [host:port]

Default is localhost:18000. Use seedlink-client --help for options (stream selection, time windows, state files, INFO queries, TLS, auth). Pass -c/--interactive for a low-level interactive shell that sends individual protocol commands (HELLO, STATION, SELECT, DATA, INFO, ...).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

seedlink_client-0.1.0.tar.gz (41.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

seedlink_client-0.1.0-py3-none-any.whl (49.1 kB view details)

Uploaded Python 3

Release history Release notifications | RSS feed

0.2.0

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page