Skip to main content

seedlink-client

SeedLink protocol client for streaming geophysical (primarily 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, SLPROTO, STATION, SELECT, DATA, INFO, ...) -- unlike the non-interactive client, it does not send HELLO or negotiate a protocol version on its own; type HELLO, then SLPROTO 4.0 to upgrade if the server supports v4 (HELP shows a full example). END (or, in v3 uni-station mode, DATA/FETCH/TIME with no prior STATION) finishes the handshake and starts printing packets as they arrive, until Enter or Ctrl-C.

Metadata

Release files for seedlink-client 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for seedlink-client 0.3.0
File Size Uploaded Provenance Actions
seedlink_client-0.3.0.tar.gz 87.5 kB With provenance Details for seedlink_client-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for seedlink-client 0.3.0
File Interpreter ABI Platform Actions
seedlink_client-0.3.0-py3-none-any.whl Python 3 none any Details for seedlink_client-0.3.0-py3-none-any.whl

Total release size: 152.4 kB

Security for seedlink-client 0.3.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

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.

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