Skip to main content

biosigIO

PyPI version Tests codecov DOI

A Python package for biosignal import/export and manipulation across modalities (EEG, EMG, iEEG, MEG, and behavioral/marker streams). biosigIO provides a unified Recording interface for loading data from many acquisition systems and archives (EEGLAB, Delsys Trigno, OTB, EDF/BDF, WFDB, XDF, MEG/CTF and BrainVision via MNE, and proprietary electrophysiology such as Intan/Blackrock via python-neo) and exporting it to standardized and serving formats (EDF/BDF, Parquet, Arrow, Zarr) with harmonized metadata.

The determination of the EDF/BDF format is based on the dynamic range of the data. If the data is within the range of 16-bit integers (~90dB), the EDF format is used. Otherwise, the BDF format is used. This is to ensure that the data is stored in the most efficient format possible. This determination is made automatically using SVD decomposition and/or FFT to determine the dynamic range of the data. (Alternatively, the user can override the format selection by explicitly indicating their desired format).

Documentation

The documentation including installation instructions, examples, and API reference is available at https://neuromechanist.github.io/biosigio/.

Features

  • Import biosignal recordings from many systems and archives:

    • EEGLAB set files (supported)
    • Delsys Trigno (supported)
    • OTB Systems (supported)
    • EDF/BDF(+) (supported, including annotations)
    • WFDB (supported, including annotations)
    • XDF/Lab Streaming Layer (supported, multi-stream)
    • MEG: .fif and CTF .ds via MNE (supported; meg extra)
    • BrainVision .vhdr via MNE (supported; meg extra)
    • Proprietary electrophysiology via python-neo: Intan, Blackrock, Spike2, Plexon, Micromed, Neuralynx (supported; neo extra)
    • Generic CSV (supported with auto-detection)
    • Noraxon (planned)
  • Smart import:

    • Automatic file format detection based on extension
    • Specialized format detection for CSV files
    • Custom importers for system-specific formats
    • Automatic annotation/event loading (WFDB, EDF+/BDF+, and EEGLAB .set) into the events table, embedded back on EDF+/BDF+ export and carried in the Parquet/Arrow/Zarr serialization formats
    • LSL timestamp preservation for XDF files (for synchronization)
  • Export to standardized formats:

    • EDF/BDF(+) with channels.tsv metadata (automatically selects format based on signal properties, preserves annotations)
  • Serialization & serving (see docs):

    • Parquet and Arrow/Feather: lossless columnar round-trip (analytics, fast IPC); requires the arrow extra
    • Zarr: cloud-native serving store (one store serves viewing, inference, and training), a derived downsampled copy; requires the zarr extra
  • Data manipulation:

    • Channel selection
    • Metadata handling
    • Event/Annotation handling (access, add)
    • Basic signal visualization
    • Raw data access and modification

Installation

biosigIO uses UV for Python environment and package management.

From PyPI (recommended)

uv pip install biosigio

(If your own project is uv-managed, use uv add biosigio to track it as a dependency.)

From source

git clone https://github.com/neuromechanist/biosigio.git
cd biosigio
uv pip install .

Usage

Basic Example

from biosigio import Recording

# Load data with automatic format detection
rec = Recording.from_file('data.csv')  # Format detected from file extension

# Load data with explicit importer
rec = Recording.from_file('data.csv', importer='trigno')

# Plot specific channels
rec.plot_signals(['EMG1', 'EMG2'])

# Export to EDF or BDF (format automatically determined)
rec.to_edf('output.edf')

Generic CSV Import

# Import a generic CSV file
rec = Recording.from_file('data.csv', importer='csv',
                   sample_frequency=1000,  # Required if no time column
                   has_header=True,        # Whether file has header row
                   channel_names=['EMG_L', 'EMG_R', 'ACC_X'])

Channel Selection

# Select specific channels
subset_emg = rec.select_channels(['EMG1', 'EMG2', 'ACC1'])

# Select all channels of a specific type
emg_only = rec.select_channels(channel_type='EMG')

# Plot selected channels
subset_emg.plot_signals()

Metadata Handling

# Set metadata
rec.set_metadata('subject', 'S001')
rec.set_metadata('condition', 'resting')

# Get metadata
subject = rec.get_metadata('subject')

Development

Setup

  1. Clone the repository:
git clone https://github.com/neuromechanist/biosigio.git
cd biosigio
  1. Install for development (editable install with dev dependencies):
uv sync --extra dev

Running Tests

uv run pytest

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.

Acknowledgment

This project is partially supported by a Meta Reality Labs gift to @sccn and NIH 5R01NS047293.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

biosigio-1.2.0.tar.gz (168.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

biosigio-1.2.0-py3-none-any.whl (197.1 kB view details)

Uploaded Python 3

File details

Details for the file biosigio-1.2.0.tar.gz.

File metadata

  • Download URL: biosigio-1.2.0.tar.gz
  • Upload date:
  • Size: 168.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for biosigio-1.2.0.tar.gz
Algorithm Hash digest
SHA256 3c16ad5b04889f499eff47756f8f38e01f11d3a9219ddcd7ae7c95c7af37cb7d
MD5 cefbc4f65acbe72b98b5663c9ef09c99
BLAKE2b-256 8ccded9fa7eb229ed5e9a9bff7e870dca5e4cde3cdabd9f9adbf676c3412a75f

See more details on using hashes here.

Provenance

The following attestation bundles were made for biosigio-1.2.0.tar.gz:

Publisher: publish.yml on neuromechanist/biosigio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biosigio-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: biosigio-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 197.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for biosigio-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09a21d46ddaa71cf399572089ecd9439eb7be3cadc3fbc7618bb93b265a8f9c4
MD5 e295f48abb7af03ff1b93c61f3243630
BLAKE2b-256 84af8b8d5b09d93b3e1baab5822c6eb9184b363f2021da76a4ddec65fca1ab5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for biosigio-1.2.0-py3-none-any.whl:

Publisher: publish.yml on neuromechanist/biosigio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page