BrainCo BCIGo 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 bcigo_sdk
Optional Dependencies
For GUI visualization tools:
pip install pyqtgraph PySide6 numpy scipy qasync pyedflib
Quick Start
Basic Usage
import asyncio
import bcigo_sdk as sdk
async def main():
# Auto-discover and connect to device
addr, port = await sdk.mdns_start_scan()
# Create client
client = sdk.BCIGoClient(addr, port)
parser = sdk.MessageParser("bcigo", sdk.MsgType.BCIGo)
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 bcigo_sdk as sdk
# Start recording
file_path = sdk.start_edf_recording(
output_dir="./recordings",
code="P001",
sex="M",
birthdate="01-JAN-1990",
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:
The GUI scripts live in the source repository rather than the installed Python package. Run the following commands from the repository root after installing the optional dependencies.
1. Real-time EEG Viewer
Real-time visualization of 32-channel EEG data with filtering and FFT analysis.
python examples/python/eeg/eeg_32ch_realtime_gui.py
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 examples/python/eeg/eeg_32ch_edf_gui.py
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
BCIGoClient(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 tasksdisconnect_tcp_blocking()- Disconnect safely when no asyncio event loop is runningstart_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)enable_eeg_stream_mode(...)- Switch from impedance detection back to EEG streamingenable_impedance_detection_mode(...)/disable_impedance_detection_mode()- Control impedance detection modeget_device_info()- Get device informationget_battery_level()- Get battery status
Discovery and BLE
mdns_start_scan(with_sn=None)- Discover one device over the local networkmdns_start_scan_multi(callback)/mdns_stop_scan()- Discover multiple network devicesinit_adapter()- Initialize the BLE adapterble_start_scan(...)/ble_stop_scan()- Control BLE scanningble_connect(id)/ble_disconnect(id)- Connect or disconnect a BLE device
BLE operations are asynchronous. Connection, disconnection, and device command failures raise
RuntimeError and should be handled by the caller:
try:
await sdk.ble_connect(device_id)
except RuntimeError as exc:
print(f"BLE connection failed: {exc}")
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 statusadd_edf_annotation(onset_seconds, duration_seconds, description)- Add an EDF+ event marker
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 bcigo-sdk 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bcigo_sdk-1.0.3-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| bcigo_sdk-1.0.3-cp310-abi3-manylinux_2_35_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.35+ x86-64 | Details |
| bcigo_sdk-1.0.3-cp310-abi3-manylinux_2_35_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.35+ ARM64 | Details |
Total release size: 10.5 MB
Release files / bcigo_sdk-1.0.3-cp310-abi3-win_amd64.whl
| Download URL | bcigo_sdk-1.0.3-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
7aa8684ee2647a3454f4f7ad0c93099fcf747600d977cc61122afa555b5cfa6b
|
|
BLAKE2b-256 checksum How to use checksums |
0912f1fb5aefd44bc09eb2b682062f3f12beee5039cc8c0215b41360917afd2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 24, 2026.
Transparency logRelease files / bcigo_sdk-1.0.3-cp310-abi3-manylinux_2_35_x86_64.whl
| Download URL | bcigo_sdk-1.0.3-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 |
860080f6e7bbef5b47197a85fd681a73235636687b38f8b7ba395f6ff3350fc8
|
|
BLAKE2b-256 checksum How to use checksums |
fcddf188ec2c0d43cbde32ab49f7477dd3079af278076da52ba322203e798d62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 24, 2026.
Transparency logRelease files / bcigo_sdk-1.0.3-cp310-abi3-manylinux_2_35_aarch64.whl
| Download URL | bcigo_sdk-1.0.3-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 |
72f968bc6fe4ddea65b4ae88196f14e139d16248c4134cabdcc46ef9968cceca
|
|
BLAKE2b-256 checksum How to use checksums |
14f1e7cc76d70c64f814b2f628dcc53980883d4c9945cf832107fba8ea332e7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 24, 2026.
Transparency log