Skip to main content

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 client
  • start_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 tasks
  • disconnect_tcp_blocking() - Disconnect safely when no asyncio event loop is running
  • start_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 streaming
  • enable_impedance_detection_mode(...) / disable_impedance_detection_mode() - Control impedance detection mode
  • get_device_info() - Get device information
  • get_battery_level() - Get battery status

Discovery and BLE

  • mdns_start_scan(with_sn=None) - Discover one device over the local network
  • mdns_start_scan_multi(callback) / mdns_stop_scan() - Discover multiple network devices
  • init_adapter() - Initialize the BLE adapter
  • ble_start_scan(...) / ble_stop_scan() - Control BLE scanning
  • ble_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 filter
  • BandStopFilter(sample_rate, low_freq, high_freq) - Bandstop/notch filter
  • NotchFilter(center_freq, sample_rate, q_factor) - Notch filter
  • SosFilter.create_band_pass(order, sample_rate, low, high) - SOS bandpass

Recording

  • start_edf_recording(...) - Start EDF recording
  • stop_edf_recording() - Stop recording
  • is_edf_recording() - Check recording status
  • add_edf_annotation(onset_seconds, duration_seconds, description) - Add an EDF+ event marker

Enums

  • EegSampleRate: SR_250Hz, SR_500Hz, SR_1000Hz
  • EegSignalGain: GAIN_1, GAIN_2, GAIN_4, GAIN_6, GAIN_8, GAIN_12
  • EegSignalSource: 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 2.1.1

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

Built distributions (wheels)

Table of built distributions (wheels) for bcigo-sdk 2.1.1
File Interpreter ABI Platform
bcigo_sdk-2.1.1-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
bcigo_sdk-2.1.1-cp310-abi3-manylinux_2_35_x86_64.whl CPython 3.10 abi3 Linux glibc 2.35+ x86-64 Details
bcigo_sdk-2.1.1-cp310-abi3-manylinux_2_35_aarch64.whl CPython 3.10 abi3 Linux glibc 2.35+ ARM64 Details

Total release size: 11.0 MB

Release files / bcigo_sdk-2.1.1-cp310-abi3-win_amd64.whl

Download URL bcigo_sdk-2.1.1-cp310-abi3-win_amd64.whl
Size 2.7 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7980af993f39837ebc9264c69e7e8896b2131a0b3628d49f3a27e3aa8cc21c5a
BLAKE2b-256 checksum
How to use checksums
712a42635dc193948d399d9758bac4129f176a58c49b1e8e0d55830cdd72f80a
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 Oct 8, 2026.

Transparency log

Release files / bcigo_sdk-2.1.1-cp310-abi3-manylinux_2_35_x86_64.whl

Download URL bcigo_sdk-2.1.1-cp310-abi3-manylinux_2_35_x86_64.whl
Size 4.3 MB
Tags CPython 3.10 Linux glibc 2.35+ x86-64 abi3
SHA-256 checksum
How to use checksums
3151a94d71b11f9aa436dffe16c8502f1299dd50e821750551e3a2aec1e1e71a
BLAKE2b-256 checksum
How to use checksums
1f3770f296379f1cdac2a460f40c21f0b99fc08375b6f32e099b0cc6383ef226
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 Oct 8, 2026.

Transparency log

Release files / bcigo_sdk-2.1.1-cp310-abi3-manylinux_2_35_aarch64.whl

Download URL bcigo_sdk-2.1.1-cp310-abi3-manylinux_2_35_aarch64.whl
Size 4.0 MB
Tags CPython 3.10 Linux glibc 2.35+ ARM64 abi3
SHA-256 checksum
How to use checksums
9912d3bab9a91447318e2690a6c44e49fd1aa4fc75de62783c16917c79a17baf
BLAKE2b-256 checksum
How to use checksums
ade156d53fa9189a2bb017e5fbc23dfb090c1a86cbcfd94bafb7a18d6bc05b34
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 Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

2.1.2

3 release files

This release

2.1.1 This release

3 release files

2.1.0

3 release files

1.0.3

3 release files

1.0.2

3 release files

1.0.1

3 release files

1.0.0

4 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