Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

harp-python-0.2.0.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

harp_python-0.2.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file harp-python-0.2.0.tar.gz.

File metadata

  • Download URL: harp-python-0.2.0.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.13

File hashes

Hashes for harp-python-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f711572c9b158ee98442667163fa8bf27bf27369eb354efe42a2066e0b31330e
MD5 bbd4f25d725de1cbad8f75ce6003cf11
BLAKE2b-256 c32f96edcb17e786f5ffdf63aa458cf281e196f8b0492367df14126832e7f8f6

See more details on using hashes here.

File details

Details for the file harp_python-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: harp_python-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for harp_python-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c0c88783acbce3b1c266423fd563b23f739d7125c0a573963d9d025041d5792
MD5 b09b9408a5f5a56b47065b396e423c5b
BLAKE2b-256 1f05743ca6c6e3bf066586f51b5dd6fc4d651d8bf87f001066c5e775eab4258c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page