Skip to content

OpenEarable/open-earable-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open Wearable

Python toolkit for parsing and analyzing multi-sensor OpenEarable recordings.

Installation

pip install open-wearables

For local development:

git clone https://github.com/OpenEarable/open-earable-python.git
cd open-earable-python
python -m venv .venv
source .venv/bin/activate
pip install -e .

Quick Example

from open_wearables import SensorDataset

dataset = SensorDataset("recording.oe")

# Combined time-indexed DataFrame of all parsed sensors
df = dataset.get_dataframe()

# Per-sensor views
imu_df = dataset.imu.df
ppg_red = dataset.ppg["ppg.red"]
audio_df = dataset.get_audio_dataframe()

IPC WebSocket Example

import asyncio
from open_wearables import OpenWearableIPCClient


async def main() -> None:
    async with OpenWearableIPCClient() as client:
        await client.start_scan()
        devices = await client.get_discovered_devices()
        wearable = client.wearable(devices[0].id)

        await wearable.connect()
        await wearable.actions.synchronize_time()

        sensors = await wearable.actions.list_sensors()
        stream = await wearable.streams.sensor_values(sensor_id=sensors[0].sensor_id)
        async for event in stream:
            print(event.data)
            break
        await stream.close()


asyncio.run(main())

IPC Audio Example

import asyncio
from open_wearables import OpenWearableIPCClient


async def main() -> None:
    async with OpenWearableIPCClient("ws://192.168.1.23:8765/ws") as client:
        await client.audio.store_sound_file("beep_ok", "beep.wav", codec="wav")
        await client.audio.play_sound("beep_ok", volume=1.0, codec="wav")


asyncio.run(main())

Documentation

Package Architecture

The library is organized into focused layers:

  • open_wearables.schema: sensor schema types and default schema builders.
  • open_wearables.parsing: stream parsing, payload parsers, and microphone helpers.
  • open_wearables.data: high-level dataset API (SensorDataset) and sensor accessors.
  • open_wearables.ipc: asynchronous WebSocket IPC client and protocol models.

Legacy flat modules (open_wearables.scheme, open_wearables.parser, open_wearables.dataset) remain available as compatibility facades.

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages