Python client library for the Arrakis low-latency timeseries data distribution platform
Project description
arrakis-python
Arrakis Python client library
Python client library for the Arrakis low-latency timeseries data distribution platform. Query, stream, and publish timeseries data.
Resources
Installation
With pip:
pip install arrakis
With conda:
conda install -c conda-forge arrakis-python
Where to Start
- Tutorial — New to arrakis? Fetch your first timeseries data step by step.
- User Guide — Fetching, streaming, channel discovery, publishing, the CLI, and more.
- Background — How the system works: Arrow Flight, Kafka, multiplexing, and the data model.
- API Reference — Auto-generated documentation from source code.
Features
- Stream live and historical timeseries data
- Describe channel metadata
- Search for channels matching a set of conditions
- Publish timeseries data
- Command-line interface for all operations
Quickstart
Fetch timeseries
import arrakis
start = 1187000000
end = 1187001000
channels = [
"H1:CAL-DELTAL_EXTERNAL_DQ",
"H1:LSC-POP_A_LF_OUT_DQ",
]
block = arrakis.fetch(channels, start, end)
for channel, series in block.items():
print(channel, series)
where block is a [arrakis.block.SeriesBlock][] and series is a
[arrakis.block.Series][].
Stream timeseries
1. Live data
import arrakis
channels = [
"H1:CAL-DELTAL_EXTERNAL_DQ",
"H1:LSC-POP_A_LF_OUT_DQ",
]
for block in arrakis.stream(channels):
print(block)
2. Historical data
import arrakis
start = 1187000000
end = 1187001000
channels = [
"H1:CAL-DELTAL_EXTERNAL_DQ",
"H1:LSC-POP_A_LF_OUT_DQ",
]
for block in arrakis.stream(channels, start, end):
print(block)
Describe metadata
import arrakis
channels = [
"H1:CAL-DELTAL_EXTERNAL_DQ",
"H1:LSC-POP_A_LF_OUT_DQ",
]
metadata = arrakis.describe(channels)
where metadata is a dictionary mapping channel names to
[arrakis.channel.Channel][].
Find channels
import arrakis
for channel in arrakis.find("H1:LSC-*"):
print(channel)
where channel is a [arrakis.channel.Channel][].
Count channels
import arrakis
count = arrakis.count("H1:LSC-*")
Publish timeseries
from arrakis import Channel, Publisher, SeriesBlock, Time
import numpy
# admin-assigned ID
publisher_id = "my_producer"
# define channel metadata
metadata = {
"H1:FKE-TEST_CHANNEL1": Channel(
"H1:FKE-TEST_CHANNEL1",
data_type=numpy.float64,
sample_rate=64,
),
"H1:FKE-TEST_CHANNEL2": Channel(
"H1:FKE-TEST_CHANNEL2",
data_type=numpy.int32,
sample_rate=32,
),
}
publisher = Publisher(publisher_id)
publisher.register()
with publisher:
# create block to publish
series = {
"H1:FKE-TEST_CHANNEL1": numpy.array([0.1, 0.2, 0.3, 0.4], dtype=numpy.float64),
"H1:FKE-TEST_CHANNEL2": numpy.array([1, 2], dtype=numpy.int32),
}
block = SeriesBlock(
1234567890 * Time.SECONDS, # time in nanoseconds for first sample
series, # the data to publish
metadata, # the channel metadata
)
# publish timeseries
publisher.publish(block)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arrakis-0.11.1.tar.gz.
File metadata
- Download URL: arrakis-0.11.1.tar.gz
- Upload date:
- Size: 76.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.5 cpython/3.13.12 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a8f6733adce3319005e6c2202b4099e93a20beb7974380e0a5ea00da5e92070
|
|
| MD5 |
0a019448d19af9071421e6e41b17acf7
|
|
| BLAKE2b-256 |
be94e22b7c18b21626a3d8704bf4cc96e777b58a8d66a2528ed19addfd20abf5
|
File details
Details for the file arrakis-0.11.1-py3-none-any.whl.
File metadata
- Download URL: arrakis-0.11.1-py3-none-any.whl
- Upload date:
- Size: 73.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.5 cpython/3.13.12 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c0696822876ccda830640a528e6e4615785b12524b8dacf61bf1bde973e881d
|
|
| MD5 |
d44eef760fe171072a489de38624a795
|
|
| BLAKE2b-256 |
6b63107bd317c8518677438bee5a00483516cc86d305cdf48c4aba997097629c
|