NeXus Streamer
Streams event and metadata from a NeXus file into Kafka, mimicking data acquisition from a live instrument. This facilitates testing software which consume these data.
This Python implementation is intended to replace a C++ implementation (https://github.com/ess-dmsc/NeXus-Streamer) and should be much lower effort to maintain. The C++ implmentation is not yet obsolete; features missing from this implementation are documented in tickets.
Installation
Python 3.7 or higher is required. https://www.python.org/downloads/
To install from source with setuptools do
python setup.py install
or to install from conda do
conda install -c conda-forge -c ess-dmsc nexus-streamer
Windows users must install the Kafka library from pypi
pip install confluent-kafka
and check installation was successful by running
nexus_streamer --help
Usage
usage: nexus_streamer [-h] [--version]
[--graylog-logger-address GRAYLOG_LOGGER_ADDRESS]
[--log-file LOG_FILE] [-c CONFIG_FILE]
[-v {Trace,Debug,Warning,Error,Critical}] -f
FILENAME [--json-description JSON_DESCRIPTION]
-b BROKER -i INSTRUMENT [-s] [-z]
NeXus Streamer Args that start with '--' (eg. --version) can also be set in a
config file (specified via -c). Config file syntax allows: key=value,
flag=true, stuff=[a,b,c] (for details, see syntax at https://goo.gl/R74nmi).
If an arg is specified in more than one place, then commandline values
override environment variables which override config file values which
override defaults.
optional arguments:
-h, --help show this help message and exit
--version Print application version and exit [env var: VERSION]
--graylog-logger-address GRAYLOG_LOGGER_ADDRESS
<host:port> Log to Graylog [env var:
GRAYLOG_LOGGER_ADDRESS]
--log-file LOG_FILE Log filename [env var: LOG_FILE]
-c CONFIG_FILE, --config-file CONFIG_FILE
Read configuration from an ini file [env var:
CONFIG_FILE]
-v {Trace,Debug,Warning,Error,Critical}, --verbosity {Trace,Debug,Warning,Error,Critical}
Set logging level [env var: VERBOSITY]
-f FILENAME, --filename FILENAME
NeXus file to stream data from [env var: FILENAME]
--json-description JSON_DESCRIPTION
If provided use this JSON template instead of
generating one from the NeXus file [env var:
JSON_FILENAME]
-b BROKER, --broker BROKER
<host[:port]> Kafka broker to forward data into [env
var: BROKER]
-i INSTRUMENT, --instrument INSTRUMENT
Used as prefix for topic names [env var: INSTRUMENT]
-s, --slow Stream data into Kafka at approx realistic rate (uses
timestamps from file) [env var: SLOW]
-z, --single-run Publish only a single run (otherwise repeats until
interrupted) [env var: SINGLE_RUN]
Developer information
See README-dev.md
Metadata
Release files for nexus-streamer 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nexus-streamer-0.1.0.tar.gz | 15.7 kB | Without provenance | Details for nexus-streamer-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nexus_streamer-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for nexus_streamer-0.1.0-py3-none-any.whl |
Total release size: 34.7 kB
Release files / nexus-streamer-0.1.0.tar.gz
| Download URL | nexus-streamer-0.1.0.tar.gz |
|---|---|
| Size | 15.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a259ec18086a3b36ed40656a999cd22d7bba608afa55b2172ad262344bfa72d6
|
|
BLAKE2b-256 checksum How to use checksums |
90106bb5e359181d181cb11b4f3716046e8566e0ed030539f186a76aa2ef6798
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5
|
Release files / nexus_streamer-0.1.0-py3-none-any.whl
| Download URL | nexus_streamer-0.1.0-py3-none-any.whl |
|---|---|
| Size | 19.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f84ea69279052d91bf8eb8306616ff21a5fda1770d139ecfbff5fe64f1591a21
|
|
BLAKE2b-256 checksum How to use checksums |
93a3ad17502aa3f4afe7b3c9093b6de0104176926cc535e64c523aae6aaf8b8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5
|
Security for nexus-streamer 0.1.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.