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.2.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.2.0
File Size Uploaded Provenance
pybemobil-0.2.0.tar.gz 158.3 kB With provenance Details

Built distribution (wheel)

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

Total release size: 280.1 kB

Release files / pybemobil-0.2.0.tar.gz

Download URL pybemobil-0.2.0.tar.gz
Size 158.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5cf1f6927b15692c6af75291d50bad5e40948affa44cc5b68f18a45dbae2750b
BLAKE2b-256 checksum
How to use checksums
e0cf1ffd92fa0458f2a56226eb73b69b15f4c17c04a8c377797f8440349bae83
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 20, 2026.

Transparency log

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

Download URL pybemobil-0.2.0-py3-none-any.whl
Size 121.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fcb2a6896ddedd98c0f84f08fc07f762a6ce88d4a2cd69e175ad126a71c9ffb5
BLAKE2b-256 checksum
How to use checksums
0f58cf5703400e76efb75d50b850e9dc996fb37e327866654447f6974d559db8
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 20, 2026.

Transparency log

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pybemobil-0.2.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 Oct 20, 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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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