A python library for retrieving data from the EPICS Archiver Appliance.
Project description
Python EPICS Archiver Appliance library
Python package to interact with the EPICS Archiver Appliance.
Installation
The epicsarchiver-retrieval-client can be installed using:
pip install epicsarchiver-retrieval-client
The core package has minimal dependencies (protobuf + pytz) and is sufficient for parsing .pb files
and working with ArchiveEvent objects directly. Heavy dependencies are opt-in via extras:
| Extra | Installs | Use when |
|---|---|---|
[polars] |
polars | you want get_data() to return a DataFrame |
[sync] |
requests | you want the synchronous ArchiverRetrieval client |
[async] |
aiohttp | you want the async AsyncArchiverRetrieval client |
[cli] |
click, rich | you want the epicsarchiver command-line tool |
[all] |
everything above | full functionality |
# Everything (recommended for most users)
pip install "epicsarchiver-retrieval-client[all]"
# Core only — parse local .pb files, no HTTP clients or DataFrames
pip install epicsarchiver-retrieval-client[all]
# Sync retrieval with DataFrame output
pip install "epicsarchiver-retrieval-client[polars,sync]"
Quick start
The package also installs a command line tool. Used to fetch data from the archiver and display in the terminal.
$ arch-retrieval get --help
Usage: arch-retrieval get [OPTIONS] PVS...
Print out data from an archiver cluster.
ARGUMENT pvs What pvs to get data of.
Example usage:
.. code-block:: console
arch-retrieval --hostname archiver-01.example.com get PV_NAME1 PV_NAME2
Options:
--debug Turn on debug logging
-s, --start [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S|%Y-%m-%dT%H:%M:%S.%f|%Y-%m-%d %H:%M:%S.%f]
Start time of query [default: 30 seconds
ago]
-e, --end [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S|%Y-%m-%dT%H:%M:%S.%f|%Y-%m-%d %H:%M:%S.%f]
End time of query, [default: now]
-p, --processor-name [FIRSTSAMPLE|LASTSAMPLE|FIRSTFILL|LASTFILL|MEAN|MIN|MAX|COUNT|NCOUNT|NTH|MEDIAN|STD|JITTER|IGNOREFLYERS|FLYERS|VARIANCE|POPVARIANCE|KURTOSIS|SKEWNESS|LINEAR|LOESS|OPTIMIZED|OPTIMLASTSAMPLE|CAPLOTBINNING|DEADBAND|ERRORBAR]
PreProcessor to use
Docs at https://epicsarchiver.readthedocs.io/en/latest/user/userguide.html#processing-of-data
-b, --bin_size INTEGER Bin size (mostly in seconds) for
preprocessor.
--help Show this message and exit.
Note you can also specify a hostname for the archiver either with an environment variable:
export EPICSARCHIVER_HOSTNAME=archiver-01.example.com
To fetch data using the Python library (requires [polars,sync]):
from epicsarchiver import ArchiverAppliance
from epicsarchiver.retrieval.archiver_retrieval import ArchiverRetrieval
# High-level: returns a polars DataFrame
retrieval = ArchiverRetrieval("archiver-01.example.com")
df = retrieval.get_data("my:pv", start="2018-07-04 13:00", end="2018-07-04 14:00")
# DataFrame columns: date (ns UTC), val, severity, status, field_values, headers
# Low-level: returns ArchiveEventsData (no polars required)
metadata, events = retrieval.get_events(
"my:pv",
start=datetime(2018, 7, 4, 13, 0, tzinfo=UTC),
end=datetime(2018, 7, 4, 14, 0, tzinfo=UTC),
)
To search for PV names:
# Without time range — returns all matching PVs
pv_list = retrieval.search("(?i)^my-system:.*:temperature$")
# With time range — only PVs that recorded data in the given window
pv_list = retrieval.search(
"(?i)^my-system:.*:temperature$",
start=datetime(2026, 1, 1, tzinfo=UTC),
end=datetime(2026, 1, 2, tzinfo=UTC),
)
Development
The package is built and packaged with Hatch.
pip install hatch
Run all checks and code coverage:
hatch run all
Run tests:
hatch test
Run formatting and check:
hatch fmt
Run local docs:
hatch run dev:docs-live
Regenerate protobuf python api:
hatch run dev:protoc-gen
License
Distributed under the terms of the MIT license
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 epicsarchiver_retrieval_client-1.0.0.tar.gz.
File metadata
- Download URL: epicsarchiver_retrieval_client-1.0.0.tar.gz
- Upload date:
- Size: 65.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78b2a73c26f4c32dbe53e971a6441eb214425daf080b3e9e76ed51825258e46c
|
|
| MD5 |
e79cbb8a50a5f9b1765cc12dc52b6d44
|
|
| BLAKE2b-256 |
67dcb4f305bf0054e5e40a7f4a1db91dba428dc6dada958796d9a598e3bf352c
|
Provenance
The following attestation bundles were made for epicsarchiver_retrieval_client-1.0.0.tar.gz:
Publisher:
release.yml on archiver-appliance/epicsarchiver-retrieval-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epicsarchiver_retrieval_client-1.0.0.tar.gz -
Subject digest:
78b2a73c26f4c32dbe53e971a6441eb214425daf080b3e9e76ed51825258e46c - Sigstore transparency entry: 1755001609
- Sigstore integration time:
-
Permalink:
archiver-appliance/epicsarchiver-retrieval-client@650dc08d4903e9dd306912893dc872bc45ffba2d -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/archiver-appliance
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@650dc08d4903e9dd306912893dc872bc45ffba2d -
Trigger Event:
push
-
Statement type:
File details
Details for the file epicsarchiver_retrieval_client-1.0.0-py3-none-any.whl.
File metadata
- Download URL: epicsarchiver_retrieval_client-1.0.0-py3-none-any.whl
- Upload date:
- Size: 40.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c57b671dd60bccec20896843942637ac7c4a1912c97cc38d53ac9ca5f9f4aff
|
|
| MD5 |
15b0397debd1cc449bdf5a6f4426756f
|
|
| BLAKE2b-256 |
7e8cc8d74016dfc5f7082933df61da7a077b913cfe3abc5de9def505877660c1
|
Provenance
The following attestation bundles were made for epicsarchiver_retrieval_client-1.0.0-py3-none-any.whl:
Publisher:
release.yml on archiver-appliance/epicsarchiver-retrieval-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epicsarchiver_retrieval_client-1.0.0-py3-none-any.whl -
Subject digest:
2c57b671dd60bccec20896843942637ac7c4a1912c97cc38d53ac9ca5f9f4aff - Sigstore transparency entry: 1755001678
- Sigstore integration time:
-
Permalink:
archiver-appliance/epicsarchiver-retrieval-client@650dc08d4903e9dd306912893dc872bc45ffba2d -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/archiver-appliance
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@650dc08d4903e9dd306912893dc872bc45ffba2d -
Trigger Event:
push
-
Statement type: