A (distributed) data logger for the (physics) lab.
Project description
Lab Data Logger ‒ A (distributed) CLI data logger for the (physics) lab.
A command-line tool that allows logging of data locally or over a network to a InfluxDB.
Installation
pip install lab_data_logger
Usage
Basic usage
Lab Data Logger comes with a CLI tool, ldl
. To get help with all the available options,
use ldl --help
.
In these examples
Setting up a data source
First, we setup a data service that provides data to be logged. As an example, we use
the RandomNumerService
provided. Here, we want to
$ ldl service run --port 18862 lab_data_logger.services.RandomNumberService
Trying to start RandomNumberService from lab_data_logger.services
Started RandomNumberService on port 18862.
Setting up the logger
Second, in order to log te data provided by this service, we first start a logger. We want the Logger to be accessible at port 18866. We pass the default host port and database of the InfluxDB explicitly for demonstration:
$ ldl logger --port 18866 start --host localhost --port 8083 --database test
Started logger on port 18866.
Open another terminal to add the data service to the logger:
ldl logger --port 18866 add --host localhost --port 18862
If succesful, the terminal where the logger service was started wil print Connected to RANDOMNUMBER on port 18862
Show logger status
$ ldl logger --port 18866 show
LAB DATA LOGGER
Logging to test on localhost:8083 (processed entry 66).
Pulling from these services:
MEASUREMENT | HOSTNAME | PORT | COUNTER
----------- | ------------ | ------ | -------
test | localhost | 18862 | 66
Creating your own data services
To make use of LDL, you have to create your own data services by subclassing lab_data_services.services.LabDataService
. An example is given in the examples folder.
To start this data service, use the relative path from your current location, for example from the parent directory of the cloned git repo:
$ ldl service run lab_data_logger.examples.const_numbers.ConstNumberService
Trying to start ConstNumberService from lab_data_logger.examples.const_numbers
No module lab_data_logger.examples.const_numbers found
Looking for ConstNumberService in /home/maid/lab_data_logger/examples/const_numbers.py
Started ConstNumberService on port 18861.
Authors
- Bastian Leykauf (https://github.com/bleykauf)
License
Lab Data Logger ‒ A (distributed) CLI data logger for the (physics) lab.
Copyright © 2020 Bastian Leykauf
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
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
Hashes for lab_data_logger-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3d0a523f11730d561f3f1da74c9c13ecd4966b2c7e95713878258a8141d6641 |
|
MD5 | 4f7f41afe736641001f5714ad758542c |
|
BLAKE2b-256 | 914108aeb973af919f2e301b2d1f043c74775fb9d8057cc4e60d71a9524f6fa1 |