NeuroFlow SDK for Python
Build brain-computer interfaces in Python. Connect to 20+ EEG/BCI devices, stream real-time neural data, extract features, and run ML predictions — with zero neuroscience expertise required.
from neuroflow import Client
client = Client(base_url="http://localhost:8000", api_key="your-key")
# Discover and connect
devices = client.discover_devices()
device = client.connect(devices[0].id)
# Stream with real-time features
session = device.start_session()
for packet in session.stream():
print(f"Focus: {packet.features.focus_score:.2f}")
print(f"Alpha: {packet.features.band_powers['alpha']:.2f}")
session.stop()
Installation
pip install neuroflow
For local device access (no server needed):
pip install "neuroflow[local]"
Quick Start
Remote Mode (via API server)
from neuroflow import Client
client = Client(base_url="http://localhost:8000", api_key="your-key")
# List available devices
devices = client.discover_devices()
# Connect and start session
device = client.connect(devices[0].id)
session = device.start_session()
# Get features
features = session.get_features()
print(f"Band powers: {features.band_powers}")
print(f"Focus score: {features.focus_score}")
session.stop()
device.disconnect()
Local Mode (direct device access, no server)
from neuroflow import LocalClient
# Connect to synthetic board for development
client = LocalClient(board_id=-1)
client.connect()
# Start streaming
client.start_stream()
data = client.get_data(num_samples=512)
# Extract features locally
features = client.get_features()
print(f"Alpha power: {features.band_powers['alpha']:.4f}")
client.stop_stream()
client.disconnect()
Async Streaming
import asyncio
from neuroflow import AsyncClient
async def main():
client = AsyncClient(base_url="http://localhost:8000", api_key="your-key")
devices = await client.discover_devices()
device = await client.connect(devices[0].id)
session = await device.start_session()
async for packet in session.stream():
print(f"Focus: {packet.features.focus_score:.2f}")
if packet.features.focus_score > 0.8:
print("High focus detected!")
break
await session.stop()
asyncio.run(main())
Features
- 20+ Device Support — Muse, OpenBCI, Emotiv, BrainBit, g.tec, and more via BrainFlow
- Real-Time Processing — Sub-millisecond Rust-accelerated DSP pipeline (0.18ms P95)
- Feature Extraction — Band powers, spectral entropy, Hjorth parameters, connectivity metrics
- ML Inference — ONNX model deployment for focus detection, relaxation, and custom classifiers
- Dual Mode — Remote (API server) or Local (direct device access)
- Type-Safe — Full Pydantic models with type hints throughout
- Async Support — Native async/await with
AsyncClient
Supported Devices
| Device | Board ID | Protocol |
|---|---|---|
| Synthetic (dev) | -1 | Simulated |
| Muse 2 | 22 | Bluetooth |
| Muse S | 21 | Bluetooth |
| OpenBCI Cyton | 0 | Serial |
| OpenBCI Ganglion | 1 | Serial/BLE |
| Emotiv Insight | 25 | Bluetooth |
| BrainBit | 7 | Bluetooth |
| ... and 20+ more |
Documentation
License
MIT
Metadata
Release files for neuroflow-sdk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| neuroflow_sdk-0.1.0.tar.gz | 34.3 kB | Without provenance | Details for neuroflow_sdk-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| neuroflow_sdk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for neuroflow_sdk-0.1.0-py3-none-any.whl |
Total release size: 66.4 kB
Release files / neuroflow_sdk-0.1.0.tar.gz
| Download URL | neuroflow_sdk-0.1.0.tar.gz |
|---|---|
| Size | 34.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f135f2ce6ee625282ae39f0d0be623eed15188657ccd1bc74e4e8a4a4523905a
|
|
BLAKE2b-256 checksum How to use checksums |
b5d3bda040469f3910563250755c0b20d0c15425d70374097532a022ec9a3bc0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / neuroflow_sdk-0.1.0-py3-none-any.whl
| Download URL | neuroflow_sdk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 32.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
18f7054a29a02ba4a26c13c5429deb50f9fb4d3d309869f4e29e327a202fccca
|
|
BLAKE2b-256 checksum How to use checksums |
fd2d3341f973b7a6611747cb2fbbff099616852aafc7f72c365858273aa8854d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Security for neuroflow-sdk 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.