Skip to main content

apstrim

Logger and extractor of time-series data (e.g. EPICS PVs).

  • Data are objects indexed in time order.
  • Supported control infrastructures: EPICS Channel Access + PV Access, ADO, and LITE. Easily extendable.
  • Wide range of data objects: strings, lists, maps, NumPy arrays, and custom types.
  • Data objects can be inhomogeneous and have arbitrary frequencies.
  • Self-describing data format; no schema is required.
  • Data objects are binary serialized using MessagePack.
  • Fast online compression.
  • Fast random-access retrieval of data objects for a selected time interval.
  • Simultaneous writing and reading.
  • Typical speed of compressed serialization to a logbook file is 80 MB/s.
  • Deserialization speed is up to 1200 MB/s when the logbook is cached in memory.
  • Basic plotting of logged data.

Installation

Main dependency: msgpack,numpy

Additional dependencies:

  • lz4framed, if compression is enabled
  • EPICS PV Access requires p4p.
  • EPICS Channel Access requires caproto.
  • The program for deserialization and plotting, apstrim.view, requires pyqtgraph.
pip3 install apstrim

API reference

apstrim

scan

Examples

Serialization

# Serialization of one float64 parameter from an EPICS simulated scope IOC:
python -m apstrim -nEPICS -T59 testAPD:scope1:MeanValue_RBV
Logging finished for 1 section, 1 parList, 7.263 KB.
...

# The same with compression:
python -m apstrim -nEPICS -T59 testAPD:scope1:MeanValue_RBV --compress
Logging finished for 1 section, 1 parList, 6.101 KB. Compression ratio: 1.19
...

# Serialization of a 1000-element array and a scalar of floats:
python -m apstrim -nEPICS -T59 testAPD:scope1:MeanValue_RBV,Waveform_RBV --compress
Logging finished for 1 section, 2 parLists, 2405.354 KB. Compression ratio: 1.0
...
# Compression is poor for floating-point arrays with high entropy.

# Serialization of an incrementing integer parameter:
python -m apstrim -nLITE --compress liteHost:dev1:cycle
Logging finished for 1 section, 1 parList, 56.526 KB. Compression ratio: 1.25
...
# In this case, the normalized compressed volume is 9.3 bytes per entry.
# Each entry consists of an int64 timestamp and an int64 value, which would
# occupy 16 bytes per entry when written using the standard format.

Deserialization

Example of deserializing and plotting all parameters from several logbooks:

python -m apstrim.view -i all -p '*.aps'

Python code snippet for extracting items 1, 2, and 3 from a logbook for a 20-second interval starting on 2021-08-12 at 23:31:31:

from apstrim.scan import APScan

apscan = APScan("aLogbook.aps")
headers = apscan.get_headers()
print(headers["Index"])
extracted = apscan.extract_objects(
    span=20,
    items=[1, 2, 3],
    startTime="210812_233131",
)
print(extracted[3])  # Print the extracted data for item [3]
# Returned:
{
    "par": "liteBridge.peakSimulator:rps",  # object (PV) name of item [3]
    "times": [1628825500.8938403, 1628825510.898658],  # timestamps for item [3]
    "values": [95.675125, 95.55396],  # values for item [3]
}

Metadata

Release files for apstrim 4.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 apstrim 4.3.0
File Size Uploaded Provenance Actions
apstrim-4.3.0.tar.gz 117.7 kB Without provenance Details for apstrim-4.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for apstrim 4.3.0
File Interpreter ABI Platform Actions
apstrim-4.3.0-py3-none-any.whl Python 3 none any Details for apstrim-4.3.0-py3-none-any.whl

Total release size: 149.7 kB

Release files / apstrim-4.3.0.tar.gz

Download URL apstrim-4.3.0.tar.gz
Size 117.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4d124e6ef2b42e441fd8b6322184605340e6dda1f45603f033fd08573e33d224
BLAKE2b-256 checksum
How to use checksums
ec124196141d004262cb520d71cb5acf0b369ca25720e184b2c91361cdad7161
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / apstrim-4.3.0-py3-none-any.whl

Download URL apstrim-4.3.0-py3-none-any.whl
Size 32.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b46c8d6369bf47a9eea2d2b1b9294f3ec008d0aec4522f15f2587b12bb70169e
BLAKE2b-256 checksum
How to use checksums
c77f3dd54b1ad866617ace3bba727505569eed858843dff028adf870cca89412
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for apstrim 4.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

4.3.0 This release

2 release files No provenance

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