Python EPICS Archiver Appliance library

black status pipeline status code coverage

Python package to interact with the EPICS Archiver Appliance.

Installation

py-epicsarchiver can be installed using artifactory PyPI repository::

pip install py-epicsarchiver -i https://artifactory.esss.lu.se/artifactory/api/pypi/pypi-virtual/simple

Quick start

The package also installs a command line tool. Used to fetch data from the archiver and display in the terminal.

$ epicsarchiver --help
Usage: epicsarchiver [OPTIONS] COMMAND [ARGS]...

  Command line tool for interacting with the archiver.

Options:
  --version            Show the version and exit.
  -h, --hostname TEXT  Achiver Appliance hostname or IP [default: localhost]
  --help               Show this message and exit.

Commands:
  archive    Archive all PVs included in the files passed as parameters.
  get        Print out data from an archiver cluster.
  ioc-check  Print out statistics of a single IOC from an archiver cluster.
  rename     Rename all PVs included in the files passed as parameters.
  stats      Print out statistics from an archiver cluster.

To fetch events using the python library:

from epicsarchiver import ArchiverAppliance

archiver = ArchiverAppliance("archiver-01.example.com")
print(archiver.version)
archiver.get_pv_status(pv='BPM*')
archiver_events = archiver.get_events('my:pv', start='2018-07-04 13:00', end=datetime.utcnow())

Development

The package is built and packaged with Hatch.

pip install hatch

Run all checks and code coverage:

hatch run all

Run tests:

hatch run test

Run formatting and check:

hatch fmt

Run local docs:

hatch run docs:live

Regenerate protobuf python api:

hatch run protoc-gen

License

Distributed under the terms of the MIT license,