datalink-client 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- datalink_client-1.0.0/.gitignore +32 -0
- datalink_client-1.0.0/PKG-INFO +58 -0
- datalink_client-1.0.0/README.md +38 -0
- datalink_client-1.0.0/pyproject.toml +38 -0
- datalink_client-1.0.0/src/datalink_client/__init__.py +37 -0
- datalink_client-1.0.0/src/datalink_client/cli.py +608 -0
- datalink_client-1.0.0/src/datalink_client/client.py +555 -0
- datalink_client-1.0.0/src/datalink_client/protocol.py +114 -0
- datalink_client-1.0.0/src/datalink_client/time_utils.py +40 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Distribution / packaging
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
*.egg-info/
|
|
10
|
+
*.egg
|
|
11
|
+
|
|
12
|
+
# Virtual environments
|
|
13
|
+
.venv/
|
|
14
|
+
venv/
|
|
15
|
+
ENV/
|
|
16
|
+
|
|
17
|
+
# IDE
|
|
18
|
+
.idea/
|
|
19
|
+
.vscode/
|
|
20
|
+
*.swp
|
|
21
|
+
*.swo
|
|
22
|
+
|
|
23
|
+
# Testing
|
|
24
|
+
.pytest_cache/
|
|
25
|
+
.coverage
|
|
26
|
+
htmlcov/
|
|
27
|
+
.tox/
|
|
28
|
+
.nox/
|
|
29
|
+
|
|
30
|
+
# Misc
|
|
31
|
+
*.manifest
|
|
32
|
+
.DS_Store
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: datalink-client
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: DataLink protocol 1.1 client for reading and writing data using the DataLink protocol (e.g. EarthScope ringserver).
|
|
5
|
+
License: MIT
|
|
6
|
+
Keywords: datalink,earthscope,ringserver,seismology
|
|
7
|
+
Classifier: Development Status :: 4 - Beta
|
|
8
|
+
Classifier: Intended Audience :: Science/Research
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering
|
|
18
|
+
Requires-Python: >=3.9
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# datalink-client
|
|
22
|
+
|
|
23
|
+
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](https://github.com/earthscope/ringserver) software.
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install datalink-client
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
### Python API
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from datalink_client import DataLink
|
|
37
|
+
|
|
38
|
+
with DataLink("localhost", 16000) as dl:
|
|
39
|
+
dl.match("FDSN:IU_COLA_.*")
|
|
40
|
+
dl.position_set("LATEST", 0)
|
|
41
|
+
dl.stream()
|
|
42
|
+
for packet in dl.collect():
|
|
43
|
+
print(packet.streamid, len(packet.data))
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Command-line client
|
|
47
|
+
|
|
48
|
+
An interactive client is available after install:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
datalink-client [host:port]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Default is `localhost:16000`. Use `datalink-client --help` for options (timeout, TLS, auth).
|
|
55
|
+
|
|
56
|
+
## Async usage
|
|
57
|
+
|
|
58
|
+
This package provides a synchronous client. For async/await support (e.g. with asyncio), use the [simpledali](https://github.com/crotwell/simpledali) package.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# datalink-client
|
|
2
|
+
|
|
3
|
+
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](https://github.com/earthscope/ringserver) software.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install datalink-client
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Python API
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
from datalink_client import DataLink
|
|
17
|
+
|
|
18
|
+
with DataLink("localhost", 16000) as dl:
|
|
19
|
+
dl.match("FDSN:IU_COLA_.*")
|
|
20
|
+
dl.position_set("LATEST", 0)
|
|
21
|
+
dl.stream()
|
|
22
|
+
for packet in dl.collect():
|
|
23
|
+
print(packet.streamid, len(packet.data))
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Command-line client
|
|
27
|
+
|
|
28
|
+
An interactive client is available after install:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
datalink-client [host:port]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Default is `localhost:16000`. Use `datalink-client --help` for options (timeout, TLS, auth).
|
|
35
|
+
|
|
36
|
+
## Async usage
|
|
37
|
+
|
|
38
|
+
This package provides a synchronous client. For async/await support (e.g. with asyncio), use the [simpledali](https://github.com/crotwell/simpledali) package.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "datalink-client"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "DataLink protocol 1.1 client for reading and writing data using the DataLink protocol (e.g. EarthScope ringserver)."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
requires-python = ">=3.9"
|
|
12
|
+
authors = []
|
|
13
|
+
keywords = ["datalink", "seismology", "ringserver", "earthscope"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Intended Audience :: Science/Research",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.9",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Programming Language :: Python :: 3.14",
|
|
25
|
+
"Topic :: Scientific/Engineering",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[project.scripts]
|
|
29
|
+
datalink-client = "datalink_client:main"
|
|
30
|
+
|
|
31
|
+
[tool.hatch.version]
|
|
32
|
+
path = "src/datalink_client/__init__.py"
|
|
33
|
+
|
|
34
|
+
[tool.hatch.build.targets.wheel]
|
|
35
|
+
packages = ["src/datalink_client"]
|
|
36
|
+
|
|
37
|
+
[tool.hatch.build.targets.sdist]
|
|
38
|
+
include = ["src/datalink_client"]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""
|
|
2
|
+
DataLink protocol 1.1 client for reading and writing data using the DataLink protocol.
|
|
3
|
+
|
|
4
|
+
DataLink is a simple, packet-based streaming protocol used in some seismological
|
|
5
|
+
data systems, primarily with EarthScope's ringserver software.
|
|
6
|
+
|
|
7
|
+
Quick start::
|
|
8
|
+
|
|
9
|
+
from datalink_client import DataLink
|
|
10
|
+
|
|
11
|
+
with DataLink("localhost", 16000) as dl:
|
|
12
|
+
dl.match("FDSN:IU_COLA_.*")
|
|
13
|
+
dl.position_set("LATEST", 0)
|
|
14
|
+
dl.stream()
|
|
15
|
+
for packet in dl.collect():
|
|
16
|
+
print(packet.streamid, len(packet.data))
|
|
17
|
+
|
|
18
|
+
Interactive client::
|
|
19
|
+
|
|
20
|
+
datalink-client [host:port]
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
from .client import DataLink
|
|
24
|
+
from .cli import main
|
|
25
|
+
from .protocol import DataLinkError, DataLinkPacket, DataLinkResponse
|
|
26
|
+
from .time_utils import timestring_to_ustime, ustime_to_timestring
|
|
27
|
+
|
|
28
|
+
__version__ = "1.0.0"
|
|
29
|
+
__all__ = [
|
|
30
|
+
"DataLink",
|
|
31
|
+
"DataLinkError",
|
|
32
|
+
"DataLinkPacket",
|
|
33
|
+
"DataLinkResponse",
|
|
34
|
+
"main",
|
|
35
|
+
"timestring_to_ustime",
|
|
36
|
+
"ustime_to_timestring",
|
|
37
|
+
]
|