BrainCo 32ch-EEG SDK
Python SDK for BrainCo 32-channel EEG Cap, providing easy-to-use APIs for real-time EEG data acquisition, processing, and visualization.
Features
- 🧠 32-Channel EEG Data Acquisition - Real-time streaming from BrainCo EEG Cap
- 📊 Signal Processing - Built-in filters (notch, bandpass, bandstop)
- 📈 Data Visualization - Ready-to-use GUI tools for real-time and offline analysis
- 💾 EDF Recording - Save data in standard EDF+ format
- 🔌 Easy Integration - Simple async API with device auto-discovery
- 🎯 SSVEP Support - Pre-configured channel selections for SSVEP experiments
Installation
pip install bc-ecap-sdk
Optional Dependencies
For GUI visualization tools:
pip install pyqtgraph PySide6 numpy scipy qasync pyedflib
Quick Start
Basic Usage
import asyncio
import bc_ecap_sdk as sdk
async def main():
# Auto-discover and connect to device
devices = await sdk.scan_devices()
addr, port = devices[0]
# Create client
client = sdk.ECapClient(addr, port)
parser = sdk.MessageParser("eeg-cap", sdk.MsgType.EEGCap)
try:
# Recommended: One-key unified stream startup
await client.start_stream(
parser,
fs=sdk.EegSampleRate.SR_250Hz,
gain=sdk.EegSignalGain.GAIN_6,
signal=sdk.EegSignalSource.NORMAL
)
# Your processing code here...
await asyncio.sleep(10)
finally:
# Safe TCP disconnect and background task release
await client.disconnect_tcp()
asyncio.run(main())
EDF Recording
import bc_ecap_sdk as sdk
# Start recording
file_path = sdk.start_edf_recording(
output_dir="./recordings",
participant_code="P001",
participant_sex="M",
participant_birthdate="01-JAN-1990",
participant_name="TestSubject"
)
# ... collect data ...
# Stop recording
sdk.stop_edf_recording()
Signal Filtering
# Create filters
notch_50hz = sdk.BandStopFilter(sample_rate=250, low_freq=49, high_freq=51)
notch_60hz = sdk.BandStopFilter(sample_rate=250, low_freq=59, high_freq=61)
bandpass = sdk.BandPassFilter(sample_rate=250, low_freq=2, high_freq=45)
# Apply filters
filtered_value = notch_50hz.apply(raw_value)
filtered_value = notch_60hz.apply(filtered_value)
filtered_value = bandpass.apply(filtered_value)
GUI Tools
The SDK includes two powerful visualization tools:
1. Real-time EEG Viewer
Real-time visualization of 32-channel EEG data with filtering and FFT analysis.
python -m bc_ecap_sdk.examples.eeg_32ch_realtime_gui
Features:
- Real-time 32-channel waveform display
- Time domain and frequency domain views
- Channel selection (All/SSVEP Wet/SSVEP Dry)
- Live filtering (50/60Hz notch + 2-45Hz bandpass)
- Statistics display (mean, std, peak-to-peak)
2. EDF File Viewer
Load and visualize EDF recordings with playback controls.
python -m bc_ecap_sdk.examples.eeg_32ch_edf_gui
Features:
- Load and replay EDF files
- Playback controls (play/pause/speed adjustment)
- Time and frequency domain analysis
- Channel selection and filtering
- Progress bar and statistics
Channel Layout
The SDK uses the standard 10-20 system with 32 channels:
FP1, FP2, F3, F4, F7, F8, Fz,
C3, C4, Cz,
P3, P4, P7, P8, Pz,
O1, O2,
T7, T8,
FC1, FC2, FC5, FC6,
CP1, CP2, CP5, CP6,
FT9, FT10,
TP9, TP10,
IO (reference)
SSVEP Channel Presets
Wet Electrodes (7 channels):
- O1, O2 (occipital)
- P3, P4 (parietal)
- P7, P8 (temporal-parietal)
- Pz (midline)
Dry Electrodes (7 channels):
- O1 (occipital)
- P3, P4 (parietal)
- C3, C4 (central)
- F3, F4 (frontal)
API Reference
Client
ECapClient(addr, port)- Create TCP clientstart_stream(parser, fs, gain, signal)- One-key high-level stream startup (Recommended)update_eeg_config(fs, gain, signal)- On-the-fly config hot-reloading (Recommended)disconnect_tcp()- Safely release TCP connections and background listener tasksstart_data_stream(parser)- Start data streaming (Advanced)set_eeg_config(sample_rate, gain, source)- Configure EEG (Advanced)start_eeg_stream()/stop_eeg_stream()- Control streaming (Advanced)get_device_info()- Get device informationget_battery_level()- Get battery status
Filters
BandPassFilter(sample_rate, low_freq, high_freq)- Bandpass filterBandStopFilter(sample_rate, low_freq, high_freq)- Bandstop/notch filterNotchFilter(center_freq, sample_rate, q_factor)- Notch filterSosFilter.create_band_pass(order, sample_rate, low, high)- SOS bandpass
Recording
start_edf_recording(...)- Start EDF recordingstop_edf_recording()- Stop recordingis_edf_recording()- Check recording status
Enums
EegSampleRate: SR_250Hz, SR_500Hz, SR_1000HzEegSignalGain: GAIN_1, GAIN_2, GAIN_4, GAIN_6, GAIN_8, GAIN_12EegSignalSource: NORMAL, TEST_SIGNAL
Examples
Check the GitHub repository for more examples:
- Real-time data streaming
- EDF recording with LSL markers
- Signal processing and filtering
- FFT analysis
- Custom data callbacks
Requirements
- Python 3.10+
- Network connection to BrainCo EEG Cap device
- Optional: GUI dependencies for visualization tools
License
See LICENSE file in the repository.
Metadata
Release files for bc-ecap-sdk 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| bc_ecap_sdk-0.5.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| bc_ecap_sdk-0.5.0-cp310-abi3-manylinux_2_35_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.35+ x86-64 | Details |
| bc_ecap_sdk-0.5.0-cp310-abi3-manylinux_2_35_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.35+ ARM64 | Details |
| bc_ecap_sdk-0.5.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 12.4 MB
Release files / bc_ecap_sdk-0.5.0-cp310-abi3-win_amd64.whl
| Download URL | bc_ecap_sdk-0.5.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
50d1361dc69fed5dc20b9192a5df49ecdef848d916807533f12c341a6963abbe
|
|
BLAKE2b-256 checksum How to use checksums |
73fa77e2d1cdf9918652e3114163155bb95af062340a813f8f6696d0dae7c76a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 3, 2026.
Transparency logRelease files / bc_ecap_sdk-0.5.0-cp310-abi3-manylinux_2_35_x86_64.whl
| Download URL | bc_ecap_sdk-0.5.0-cp310-abi3-manylinux_2_35_x86_64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.10 Linux glibc 2.35+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
94969bedc3700fd96ec78a020e57802eeec6c2eb1da9741cfb223fcb3504f588
|
|
BLAKE2b-256 checksum How to use checksums |
dd846d501a192dce5eba2af55589eb7888464b08cba48356c5bf0c14b7d34e96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 3, 2026.
Transparency logRelease files / bc_ecap_sdk-0.5.0-cp310-abi3-manylinux_2_35_aarch64.whl
| Download URL | bc_ecap_sdk-0.5.0-cp310-abi3-manylinux_2_35_aarch64.whl |
|---|---|
| Size | 3.8 MB |
| Tags | CPython 3.10 Linux glibc 2.35+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
34af43ae73ad03227aa94ea5db56c15511226ab2149b6d4a68d6f685d00d5e30
|
|
BLAKE2b-256 checksum How to use checksums |
67f522624bef1569e92ff939742beff24c1ae90c5d164eeeaa560fe2cc8d15b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 3, 2026.
Transparency logRelease files / bc_ecap_sdk-0.5.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | bc_ecap_sdk-0.5.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d644d47d0f2890fafa3bae30828f1e272db39843380a500fc3a8f1b5d1a7c73f
|
|
BLAKE2b-256 checksum How to use checksums |
66f7ca7ee7a59777297e0d552f3eff8d30068d3598e7020501bd501cb810618a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.12.6
|