Convert wearable health data from vendor schemas to Open mHealth schemas
Project description
omh-shim
Convert wearable health data from vendor schemas to Open mHealth schemas.
Status
v1.0 — initial public release. Public API is stable; converter coverage will continue to expand.
Install
pip install git+https://github.com/jupyterhealth/omh-shim.git@v1.0.1
Usage
Timestamp-based data types (one reading at a known instant):
from omh_shim import convert
omh_record = convert(
source="ow_normalized",
data_type="heart_rate",
sample={
"timestamp": "2026-04-09T08:30:00+00:00",
"type": "heart_rate",
"value": 72,
"unit": "bpm",
"source": {"source_name": "Oura Ring", "device_model": "Oura Gen 3"},
},
)
Daily data types (step_count, physical_activity, sleep_duration)
aggregate over a calendar day, so they REQUIRE an explicit timezone so the day
boundaries reflect the user's local day rather than silently assuming UTC:
from datetime import UTC
from zoneinfo import ZoneInfo
# UTC-anchored upstream data
convert(
source="oura_raw",
data_type="step_count",
sample={"day": "2026-04-09", "steps": 8432},
tz=UTC,
)
# User's local timezone
convert(
source="oura_raw",
data_type="step_count",
sample={"day": "2026-04-09", "steps": 8432},
tz=ZoneInfo("America/Los_Angeles"),
)
Pass header=True to get the full IEEE 1752.1 data-point envelope with
UUID, schema_id components, creation timestamp, modality, and optional
external_datasheets:
convert(
source="oura_raw",
data_type="heart_rate",
sample={"bpm": 72, "timestamp": "2026-04-09T08:00:00Z"},
header=True,
external_datasheets=[
{"datasheet_type": "manufacturer", "datasheet_reference": "Oura"},
],
)
# Returns:
# {
# "header": {
# "uuid": "...",
# "schema_id": {"namespace": "omh", "name": "heart-rate", "version": "2.0"},
# "source_creation_date_time": "...",
# "modality": "sensed",
# "external_datasheets": [{"datasheet_type": "manufacturer", "datasheet_reference": "Oura"}]
# },
# "body": {
# "heart_rate": {"value": 72.0, "unit": "beats/min"},
# "effective_time_frame": {"date_time": "2026-04-09T08:00:00Z"}
# }
# }
convert raises ConversionError for unknown (source, data_type) pairs,
invalid sample shapes, naive (timezone-less) datetimes, or a missing tz
for daily data types. It raises ValidationError if the converter output
fails schema validation.
Supported sources and data types (v1.0)
source |
data_type values |
|---|---|
ow_normalized |
heart_rate, heart_rate_variability, step_count, sleep_duration, sleep_episode, physical_activity |
oura_raw |
heart_rate, heart_rate_variability, step_count, sleep_duration, sleep_episode, physical_activity |
Note: heart_rate_variability targets the local placeholder schema
local:heart-rate-variability:1.0 (Open mHealth has not published a canonical
HRV schema as of 2026-04). The local: namespace is deliberate — downstream
consumers should not assume OMH-standard interoperability for HRV records.
Mapping references
docs/mappings/oura_raw.md— Oura Ring v2 API → OMH (body fields)docs/mappings/ow_normalized.md— Open Wearables normalized API → OMH (body fields)docs/mappings/ieee-1752-header.md— IEEE 1752.1 data-point header envelope
Credits
omh_shim/sources/oura_raw.py ports converter mapping logic with permission
from dicristea/oura-clinical-workbench.
See AUTHORS.md.
License
MIT. See LICENSE.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file omh_shim-1.0.2.tar.gz.
File metadata
- Download URL: omh_shim-1.0.2.tar.gz
- Upload date:
- Size: 23.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4891652b68acfb3613da5463b891275ef29e44f9bac8bdc36d6dbce02bf8546e
|
|
| MD5 |
8da1a482a3c9a32a13aeeb37f43a100e
|
|
| BLAKE2b-256 |
82487b1fc92e8340793076a92b372bd350f29127824dd8e72fb117d20413fb6b
|
Provenance
The following attestation bundles were made for omh_shim-1.0.2.tar.gz:
Publisher:
release.yaml on jupyterhealth/omh-shim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
omh_shim-1.0.2.tar.gz -
Subject digest:
4891652b68acfb3613da5463b891275ef29e44f9bac8bdc36d6dbce02bf8546e - Sigstore transparency entry: 1526371864
- Sigstore integration time:
-
Permalink:
jupyterhealth/omh-shim@1fc4a1c80f349fff0a5e487d593938e35c9dfbc1 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/jupyterhealth
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@1fc4a1c80f349fff0a5e487d593938e35c9dfbc1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file omh_shim-1.0.2-py3-none-any.whl.
File metadata
- Download URL: omh_shim-1.0.2-py3-none-any.whl
- Upload date:
- Size: 31.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45f2c0a3c56cc5f2b2392f47f6f0e08006acc7e4e6cf25631bd251e4fb1387da
|
|
| MD5 |
d7dc86c6b6be30e3b7573e36f8eed16a
|
|
| BLAKE2b-256 |
489a14c8024f3ddff292d1fd7ad4f7a3f0abc52408f906e2c8e308427afffefb
|
Provenance
The following attestation bundles were made for omh_shim-1.0.2-py3-none-any.whl:
Publisher:
release.yaml on jupyterhealth/omh-shim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
omh_shim-1.0.2-py3-none-any.whl -
Subject digest:
45f2c0a3c56cc5f2b2392f47f6f0e08006acc7e4e6cf25631bd251e4fb1387da - Sigstore transparency entry: 1526371922
- Sigstore integration time:
-
Permalink:
jupyterhealth/omh-shim@1fc4a1c80f349fff0a5e487d593938e35c9dfbc1 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/jupyterhealth
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@1fc4a1c80f349fff0a5e487d593938e35c9dfbc1 -
Trigger Event:
push
-
Statement type: