This is a library for controlling the ESS HDF5/NeXus file-writer application. The file-writer is controlled by sending commands to it via an Apache Kafka broker. This library implements the encoding/decoding of commands as well as an abstraction of this interface in order to simplify the commands and control.
You can install the library with pip by running
pip install file-writer-control
The examples directory contains different examples of how to use the library - we recommend you start there.
This library uses the kafka-python library for the communication with the Kafka broker and the python-streaming-data-types for serialising and de-serialising messages to and from the filewriter. These dependencies can be installed by executing the following command in the root of the repository:
pip install -r requirements.txt
Alternatively, to install the dependencies such that they are only available to the current user, execute the following command:
pip install --user -r requirements.txt
Note: This library was developed using Python 3.8 but it is likely that it will work with Python 3.6 and up.
For running the unit tests, execute the following command in the root of this repository:
python -m pytest -s .
First, uninstall any existing versions of this library:
pip uninstall file-writer-control
Then, from the file-writer-control root directory, run the following command:
pip install --user -e ./
rm -rf build dist
python setup.py sdist bdist_wheel
twine check dist/*
twine upload dist/*