Skip to main content

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")

Metadata

Release files for harp-python 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for harp-python 0.4.1
File Size Uploaded
harp_python-0.4.1.tar.gz 15.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for harp-python 0.4.1
File Interpreter ABI Platform
harp_python-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 28.1 kB

Release files / harp_python-0.4.1.tar.gz

Download URL harp_python-0.4.1.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
232c38c3dbcc714ff0d7bb18423f5c4a843062442f4b27f77571c7071e606eff
BLAKE2b-256 checksum
How to use checksums
ae78c894fe30960d7df9737bc0e15390b45844c857192787ea3f02666161da86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.4

Release files / harp_python-0.4.1-py3-none-any.whl

Download URL harp_python-0.4.1-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a91396ec19b76a71019b7ed2d9d550aa5c22148095759f706c70b8d808f69dd
BLAKE2b-256 checksum
How to use checksums
74588a5d1c27b50544957c51bf2a2d5342bedd4ce5cf891bc2e412ce43dd4640
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.4

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page