Skip to main content

Restora SDK

Python bindings for BrainCo Restora devices.

Installation

pip install restora-sdk

Quick Start

import asyncio

from restora_sdk import (
    GattTransport,
    RESTORA_SERVICE_UUID,
    initialize_central_adapter,
    start_scan_with_uuids,
)


async def main() -> None:
    await initialize_central_adapter()
    await start_scan_with_uuids(
        [RESTORA_SERVICE_UUID],
        GattTransport.Auto,
    )
    await asyncio.sleep(10)


asyncio.run(main())

GattTransport.Auto accepts either Bluetooth LE or GATT over BR/EDR. Use GattTransport.Le or GattTransport.BrEdr to require a specific bearer. BR/EDR devices must be paired first; platform support and prerequisites vary by operating system.

The package also provides connection and sensor streaming APIs (connect_ble, subscribe_eeg, subscribe_imu, and subscribe_ppg), record decoding helpers, and protocol frame builders.

RR-derived HRV (RMSSD)

Create one HrvCalculator per device or session and feed it the RR intervals and confidence from each PPGData callback:

from restora_sdk import HrvCalculator

hrv = HrvCalculator()


def on_ppg(_device_id: str, data) -> None:
    rmssd_ms = hrv.update(data.rr_intervals, data.hrv_confidence)
    if rmssd_ms is not None:
        print(f"RMSSD: {rmssd_ms:.1f} ms")

The default confidence threshold is 80. The calculator accepts RR intervals from 400 through 1500 ms. After five valid intervals, it rejects a value more than 150 ms from the latest five-sample mean. It returns None until the rolling window contains 40 valid intervals, then updates for each subsequently accepted interval. This SDK-derived RMSSD does not replace or identify the algorithm used by device-firmware HRV fields.

Examples

Example projects and integration guides are maintained in the source repository under sdk/examples/python. Install this package first, then run the example that matches your device and transport mode. OSS credentials used by the record upload example are read from environment variables and are not included in the package.

Support

If you run into device connection or API issues, please share your package version, Python version, operating system, and device model with the SDK maintainer.

Metadata

Release files for restora_sdk 0.2.1

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

Built distribution (wheel)

Table of built distributions (wheels) for restora_sdk 0.2.1
File Interpreter ABI Platform
restora_sdk-0.2.1-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details

Release files / restora_sdk-0.2.1-cp310-abi3-win_amd64.whl

Download URL restora_sdk-0.2.1-cp310-abi3-win_amd64.whl
Size 2.8 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
55010a47354ac1d1bd056c0a1e5a39c816c15d7398cde4a5ffa581e93239556b
BLAKE2b-256 checksum
How to use checksums
a38d8f8c3415afc6cd9f62059c9e110a82f94735c7f20113dd9888dd3d1f64df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.1 This release

1 release file

0.2.0

1 release file

0.1.0

3 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