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.
How to install
The source code is currently hosted on GitHub.
Binary installers for the latest released version are available at the Python Package Index (PyPI) and can be installed using pip
.
pip install harp-python
The list of changes between each release can be found here.
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 Distribution
Built Distribution
File details
Details for the file harp_python-0.3.0.tar.gz
.
File metadata
- Download URL: harp_python-0.3.0.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af6d406b9b7f697deabd6e70a9ed8bf1b0619bdc5672d8ed0a2eb645dbe1e79d |
|
MD5 | c6cb3f4bc88503a17f91adce4efd11dc |
|
BLAKE2b-256 | eba7104dcb4978e9d485c38677227c0252b0dacd2bd086066a41fce95ce7068c |
File details
Details for the file harp_python-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: harp_python-0.3.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5eac6e460ba3b2d9aa52626d37cf57c4a43c59ec4a741ca55950c339945238f |
|
MD5 | 2318b0940482be910b6fe53c7a4bb0cc |
|
BLAKE2b-256 | 68a3ec29a871fb25f2399cd74161a31c30fc028258ee2e2f50c599119659f53e |