A low-level interface for loading binary Harp protocol data
Project description
harp-python
A low-level interface to data collected with the Harp binary protocol.
Data model
The interface makes use of a Pydantic data model generated from Harp device schema definitions. The schema data classes are used to automatically generate binary readers for each device.
All binary data files from a single device need to be stored in the same folder alongside the device meta-schema, named device.yml
. Each register file should have the following naming convention <deviceName>_<registerAddress>.bin
.
For example, for a dataset collected with a Behavior
device, you might have:
📦device.harp
┣ 📜Behavior_0.bin
┣ 📜Behavior_1.bin
...
┗ 📜device.yml
How to use
Create device reader object from schema
import harp
reader = harp.create_reader("device.harp")
Read data from named register
reader.OperationControl.read()
Access register metadata
reader.OperationControl.register.address
Create device reader object with UTC datetime format
reader = harp.create_reader("device.harp", epoch=harp.REFERENCE_EPOCH)
Read data with message type information
reader.OperationControl.read(keep_type=True)
Read data from a specific file
reader.OperationControl.read("data/Behavior_10.bin")
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for harp_python-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c0c88783acbce3b1c266423fd563b23f739d7125c0a573963d9d025041d5792 |
|
MD5 | b09b9408a5f5a56b47065b396e423c5b |
|
BLAKE2b-256 | 1f05743ca6c6e3bf066586f51b5dd6fc4d651d8bf87f001066c5e775eab4258c |