Package to read in data from OSF files. Supported OSF versions:
- OSF4
Setting up a virtual environment and installing the current master:
Windows:
python -m venv venv
.\venv\Scripts\activate
pip install .
Linux:
python -m venv venv
. ./venv/bin/activate
pip install .
Constructing a dataframe with the samples of two channels of an OSF file:
from libosf import read_file
import pandas as pd
channels = ['System.CPU.Uptime', 'System.Device.AppUptime']
with read_file('example.osf') as file:
samples = file.get_samples(channels)
data = {
'ts_n': samples[0],
'value': samples[1],
'ch_index': samples[2]
}
df = pd.DataFrame(data=data)
More examples showing how to use this package combined with numpy, pandas, matplotlib and more can be found under ./examples/
.
Install dependencies before running:
pip install .[examples]
cd examples/
# generates a csv file with samples of "System.CPU.Uptime" at example.csv
python to_csv.py -i example.osf -c System.CPU.Uptime
# install local development version
pip install -e .
# install dependencies
pip install .[tests]
# run python unit tests
pytest
# install dependencies
pip install .[docs]
# build the html documentation
cd docs/
sphinx-build source/ build/html/
# Alternatively, if "make" is available:
make html