Skip to main content

Ability logomark
EMG-GUI
Python versions PyPI version Monthly PyPI downloads Total PyPI downloads GitHub release downloads

Real-time acquisition and visualization of OpenBCI EMG signals with Python.

EMG-GUI is a multithreaded Python package built with BrainFlow, Qt, and ModernGL. It displays raw and filtered EMG traces from OpenBCI boards alongside a live spectrogram, with support for recording and playback.

EMG-GUI displaying raw and filtered EMG traces alongside a live spectrogram

Contents

1. Installation

Requirement: Python 3.9, 3.10, 3.11, 3.12, 3.13, or 3.14.

Choose your operating system and follow the steps in order.

🍎 macOS
  1. Install EMG-GUI:

    pip install emg-gui
    
🪟 Windows
  1. Install EMG-GUI in PowerShell:

    pip install emg-gui
    
🐧 Linux — Ubuntu / Debian
  1. Install the system dependencies. For Debian and Ubuntu:

    sudo apt update
    sudo apt install \
      libgl-dev \
      libegl-dev \
      libxcb-icccm4 \
      libxcb-keysyms1 \
      libxcb-xinerama0 \
      libxcb-xkb1 \
      libxkbcommon-x11-0
    
  2. Install EMG-GUI:

    pip install emg-gui
    

Graphics troubleshooting: If the application reports an OpenGL context error, check that your graphics driver provides OpenGL 3.3 or later.

2. Hello world with synthetic data

Each script opens raw and filtered EMG traces alongside a live spectrogram. Run it with Python, then click Stream Data to begin. Close the window to exit.

Source: examples/synthetic_board.py

from emg_gui import (
    ConsoleLogger, EMGVisualizerWindow, MainsFrequency,
    OpenBCIBoard, OpenBCIBoardType, OpenBCIConfig,
)


def main():
    logger = ConsoleLogger()
    board = None
    try:
        config = OpenBCIConfig(board_type=OpenBCIBoardType.SYNTHETIC)
        board = OpenBCIBoard(logger=logger, config=config)
        EMGVisualizerWindow.run(
            logger=logger, board=board, mains_frequency=MainsFrequency.FIFTY_HZ
        )
    finally:
        if board is not None:
            board.release()
        logger.release()


if __name__ == "__main__":
    main()

3. Features

Explore and record Design and integration
Live multichannel EMG. Compare raw and filtered waveforms together on a shared per-channel scale. Automatic scaling and layout. Waveforms scale automatically, and channel plots adapt to the window size.
Per-channel spectrograms. Observe changing frequency content alongside each channel’s waveform. GPU-accelerated rendering. ModernGL renders waveforms, spectrograms, axes, and labels.
Recording and movement markers. Save raw EMG with movement start/stop markers in CSV format. Python-configured desktop GUI. Launch from your own script on Windows, macOS, or Linux.
Playback and hardware-free demos. Replay compatible recordings, explore bundled samples, or use synthetic data. Independent acquisition. Sensor polling and raw-data recording run on a worker thread, separate from visualization.
OpenBCI support. Configure Cyton, Cyton Daisy, or Ganglion, with channel counts and sampling rates taken from the selected board. Self-paced visualization. Display the latest snapshot without queuing outdated frames or reprocessing unchanged snapshots while streaming.

4. How EMG-GUI works

See the architecture guide for the component overview, component hierarchy, data flow, and thread interactions.

5. Contributing

Contributions are welcome! See CONTRIBUTING.md for the development and linting workflow, planned features, and tech debt.

Report reproducible problems through GitHub Issues, including your operating system, Python and package versions, and the full error output.


6. Acknowledgements

6.1 BrainFlow

This project uses BrainFlow for biosignal acquisition and hardware integration. BrainFlow provides a uniform API for acquiring, parsing, and analyzing EEG, EMG, ECG, and other biosensor data across a wide range of supported boards, including OpenBCI devices. BrainFlow is distributed under the MIT License.

6.2 ModernGL Spectrogram

This project uses nickcercone/spectrogram as a reference for parts of its ModernGL spectrogram rendering implementation. The referenced project demonstrates real-time audio spectrogram visualization using ModernGL and is distributed under the MIT License.

6.3 Text Rendering

This project adapts the code in How to render text with PyOpenGL? by exiled (question) and Rabbid76 (answer) for its ModernGL text renderer. The referenced contributions demonstrate text rendering with PyOpenGL and are distributed under the CC BY-SA 4.0 License.

Videos

Watch demos and tutorials on EMGAbility on YouTube.

Metadata

Release files for emg-gui 0.2.2

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

Source distribution (sdist)

Source distribution for emg-gui 0.2.2
File Size Uploaded Provenance Actions
emg_gui-0.2.2.tar.gz 2.4 MB With provenance Details for emg_gui-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for emg-gui 0.2.2
File Interpreter ABI Platform Actions
emg_gui-0.2.2-py3-none-any.whl Python 3 none any Details for emg_gui-0.2.2-py3-none-any.whl

Total release size: 4.8 MB

Release files / emg_gui-0.2.2.tar.gz

Download URL emg_gui-0.2.2.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
971ed6ee5f0c1bdcdcd118beb049121c347d6c0c453b48baf33d779fd101692d
BLAKE2b-256 checksum
How to use checksums
6ee0f1f9cfbb82f78e84a10fa28f3f52d92733bc1fedbe38c201787506767129
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 13, 2026.

Transparency log

Release files / emg_gui-0.2.2-py3-none-any.whl

Download URL emg_gui-0.2.2-py3-none-any.whl
Size 2.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
1995b3e2274e0d53583e8ebf4a5c64c04aecb2d090b2efb5fafd2434fb8c9a5e
BLAKE2b-256 checksum
How to use checksums
fea8a08507bc76cc6f03f748fee060258cbddb6ba76f24e5d83e3110134ac52e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 13, 2026.

Transparency log

Security for emg-gui 0.2.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for emg_gui-0.2.2.tar.gz

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 Nov 13, 2026.

Transparency log

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.

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