Skip to main content

ndx-wearables Extension for NWB

Store data from wearable devices in NWB

This extension is designed to help store data collected from a wide variety of wearable devices in a cross-device capable way, and with an eye towards clinical applications. For more details about the extension, see the paper "NDX-Wearables: An NWB Extension for Clinical Neuroscience" (to be presented at NER 2025).

Installation

Create a new Python environment. Python 3.11 works well, python 3.8-3.12 have been tested.

conda create -n <env_name> python=3.11

You should be able to install from pypi using pip install ndx-wearables

If you would like to install and contribute to developing the package, follow the instructions below in Installing in editable mode

Usage

To see how the data stored using this extension looks, visit our example dataset on the EMBER Archive.

You can also generate a local copy of a synthetic datasets by running the relevant examples/ scripts, for instance

python examples/activity_classification.py

Notes on Extension Usage

This extension provides three key classes (WearableTimeSeries, WearableEnumSeries, WearableEvents) to cover:

  • WearableTimeSeries for general time series data sampled from a wearable device, such as blood oxygenation level
  • WearableEnumSeries for categorical variables over time with pre-defined meanings (for example sleep stages over time)
  • WearableEvents for sparse events over long time periods (e.g. exercise events)

In addition to these classes, metadata may be required, including:

  • wearable_device is required for classes that link to a device
  • algorithm is required for many classes to indicate how the data was derived

The PhysiologicalMeasure class is povided to group together similar physiological measurements (e.g. heart rate variability, motion) from different devices/sources. This could include redundant measurements of the same physiological variable, or multiple measurements which will be fused by later processing to estimate an unknown quantity (e.g. multiple accelerometer measurements).

If these arguments are omitted, instantiating the class will raise an error. You can find working examples in the scripts under examples.

Arguments for ndx-wearables Classes

Class Name Required Arguments Optional Arguments
WearableTimeSeries name, description, data, timestamps, wearable_device, algorithm comments, resolution, conversion
WearableEnumSeries name, description, data, timestamps, wearable_device, meanings, algorithm resolution, conversion, comments
WearableEvents name, description, columns, wearable_device, algorithm resolution, conversion, comments

These reflect typical usage in constructors. For full context or updates, refer to the class definitions in src/pynwb/ndx_wearables and usage examples in examples.

Developing the extension

We use a gitflow model for collaborative development. Each feature should be created on a branch that branches off of the develop branch. Draft PRs back into develop should be open for each WIP feature, and marked as ready for review once the feature is complete. Periodic releases will be made from develop into main.

Installing in editable mode

Navigate to the project root cd path/to/ndx-wearables, then install the required dependencies. For developers, use:

pip install -r requirements-dev.txt

Custom extensions are added to the extension spec YAML file by running:

python src/spec/create_extension_spec.py

After running this script, you can verify that the extensions are correctly added to spec/ndx-wearables.extensions.yaml.

Running test code may be done with PyTest using the test files located in src/pynwb/tests.

To use custom extensions outside a PyTest setting, they must be registered by navigating to the directory root and installing the package:

cd path/to/ndx-wearables
pip install -e .

This extension was created using ndx-template.

Metadata

Release files for ndx-wearables 0.2.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 ndx-wearables 0.2.1
File Size Uploaded
ndx_wearables-0.2.1.tar.gz 26.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ndx-wearables 0.2.1
File Interpreter ABI Platform
ndx_wearables-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 36.2 kB

Release files / ndx_wearables-0.2.1.tar.gz

Download URL ndx_wearables-0.2.1.tar.gz
Size 26.9 kB
Tags Source
SHA-256 checksum
How to use checksums
61065073c82ae85dd0fbc5380a91ef9c959b238334cdf48c618cc9302e738d27
BLAKE2b-256 checksum
How to use checksums
8fec18d605fb0961cb34b3610035ebc987f13e8dc65216d20358492d199b4644
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2025.

Transparency log

Release files / ndx_wearables-0.2.1-py3-none-any.whl

Download URL ndx_wearables-0.2.1-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63ef71b531ce221c334f63bb4a682f10f6e3633cfda6b962afbe4cd9c25bf194
BLAKE2b-256 checksum
How to use checksums
99680404e6dca189f5e2f837e390796cecb829794d7704e03ea766886227af25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.3

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