Skip to main content

pybemobil

PyPI DOI

MoBI data loading, preprocessing, and visualization built on MNE-Python.

Structure

pybemobil/
├── io/                          # Data I/O
│   ├── xdf.py                   # XDFLoader: multimodal XDF loading, stream alignment
│   ├── alignment.py             # align_stream_to_timestamps (timestamp-aware interpolation)
│   ├── bids_export.py           # BIDS export wrappers around mne_bids
│   └── utils.py                 # I/O helpers
├── preproc/                     # Preprocessing
│   ├── preprocessing.py         # EEGPreprocessor: ZapLine -> bad ch -> filter -> ASR -> ICA pipeline
│   ├── epoching.py              # EpochPreparer, stimulus renaming helpers
│   ├── motion.py                # Rigid body kinematics (find, process, split)
│   └── utils.py                 # ASR, ZapLine, ICA, dipole fitting, provenance, misc
├── viz/                         # Visualization
│   ├── plotting.py              # ERP, PSD, and component plots
│   └── utils.py                 # Plot helpers
├── examples/                    # Runnable example scripts
│   ├── preprocessing.py         # Full EEG preprocessing walkthrough
│   ├── plotting.py               # Visualization walkthrough (run preprocessing.py first)
│   ├── xdf_loading.py           # XDF multimodal loading
│   ├── motion_processing.py     # Rigid body kinematics
│   └── bids_export_example.py   # BIDS export
└── data/
    └── montages/                # EEG electrode montage files (.elc, .fif)

Modules

io - Load XDF multimodal recordings into MNE Raw objects, align auxiliary streams (ECG, gaze, EMG, EDA) to a common time grid, and export datasets to BIDS.

preproc - Full EEG preprocessing pipeline (bandpass, bad channel detection, ASR, ICA, dipole fitting), epoch preparation, and rigid body motion capture kinematics.

viz - ERP and PSD plotting utilities built on MNE and matplotlib.

examples - Self-contained scripts demonstrating major features. Run directly or open as notebooks (percent-format cells).

Installation

Install the latest release from PyPI:

pip install pybemobil

To also install the JAX-accelerated AMICA backend (the default ICA method, which falls back to Picard when this is missing):

pip install "pybemobil[jamica]"

Alternatively:

  • Latest development version from GitHub:

    pip install git+https://github.com/BeMoBIL/pybemobil.git
    
  • From source, in editable mode (for development):

    git clone https://github.com/BeMoBIL/pybemobil.git
    cd pybemobil
    pip install -e ".[dev]"
    

We recommend installing into a fresh environment, e.g. conda create -n pybemobil python=3.12.

Quick start

from pybemobil.io import XDFLoader
from pybemobil.preproc import EEGPreprocessor

# Load a multimodal XDF recording
loader = XDFLoader(montage="easycap-M1")  # or a path to your .elc/.fif
recording = loader.load("sub-01_task-walk_run-01.xdf")

# Run the full preprocessing pipeline; outputs are named after fname_out
preprocessor = EEGPreprocessor(loader=loader)
raw_clean, report, metadata = preprocessor.run_raw(
    recording.raw,
    fname_out="derivatives/pybemobil/sub-01/eeg/sub-01_task-walk_run-01_eeg.fif",
)

See pybemobil/examples/ for complete worked examples:

Feature Example script
XDF multimodal loading pybemobil/examples/xdf_loading.py
EEG preprocessing pipeline pybemobil/examples/preprocessing.py
Visualization (run preprocessing.py first) pybemobil/examples/plotting.py
Rigid body kinematics pybemobil/examples/motion_processing.py
BIDS export pybemobil/examples/bids_export_example.py

Citing

If you use pybemobil in your work, please cite it. The "Cite this repository" button on GitHub (generated from CITATION.cff) gives the reference in APA and BibTeX format. Every release is archived on Zenodo; to cite pybemobil in general, use the DOI 10.5281/zenodo.23480659, which always resolves to the latest version.

pybemobil is a Python implementation of the BeMoBIL pipeline, so please consider also citing:

Klug, M., Jeung, S., Wunderlich, A., Gehrke, L., Protzak, J., Djebbara, Z., Argubi-Wollesen, A., Wollesen, B., & Gramann, K. (2022). The BeMoBIL Pipeline for automated analyses of multimodal mobile brain and body imaging data. bioRxiv. https://doi.org/10.1101/2022.09.29.510051

License

pybemobil is released under the BSD 3-Clause License.

Contributing

Contributions are welcome! To report a bug or suggest a feature, please open an issue. For development setup, the pull request workflow, testing and releases, see CONTRIBUTING.md.

Metadata

Release files for pybemobil 0.3.0

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

Source distribution (sdist)

Source distribution for pybemobil 0.3.0
File Size Uploaded Provenance Actions
pybemobil-0.3.0.tar.gz 162.3 kB With provenance Details for pybemobil-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pybemobil 0.3.0
File Interpreter ABI Platform Actions
pybemobil-0.3.0-py3-none-any.whl Python 3 none any Details for pybemobil-0.3.0-py3-none-any.whl

Total release size: 286.6 kB

Release files / pybemobil-0.3.0.tar.gz

Download URL pybemobil-0.3.0.tar.gz
Size 162.3 kB
Tags Source
SHA-256 checksum
How to use checksums
12ea570cc606d13180379d393516738fc35fad7305f4e3dca59eeb444f298726
BLAKE2b-256 checksum
How to use checksums
8986777a24d71d539b19cdc69f28ab58fa743d599317f270d77cb95e7928a50f
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 24, 2026.

Transparency log

Release files / pybemobil-0.3.0-py3-none-any.whl

Download URL pybemobil-0.3.0-py3-none-any.whl
Size 124.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f02a1695d332540d1ec7264953a8fccb3f80a3f885c7a8c1bd1effb839698a2e
BLAKE2b-256 checksum
How to use checksums
48629520e96374c533742ddea47faaf85c8c99194ec9c7bac4a1b0609013050d
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 24, 2026.

Transparency log

Security for pybemobil 0.3.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.

Full provenance

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

Select from 2 files

Attestation for pybemobil-0.3.0.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 24, 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