Aloha to the PNPL library! 🍍

Aloha to the PNPL library! 🍍#

PNPL is a friendly Python toolkit for loading and processing brain datasets for deep learning. It ships with ready‑to‑use dataset classes (PyTorch Dataset) and simple utilities so you can focus on modeling, not file plumbing.

Get Started#

  1. Install PNPL

pip install pnpl
  1. Load a single run of LibriBrain Speech and iterate samples

from pnpl.datasets.libribrain2025 import constants
from pnpl.datasets import LibriBrainSpeech

ds = LibriBrainSpeech(
    data_path="./data/LibriBrain",
    preprocessing_str="bads+headpos+sss+notch+bp+ds",
    include_run_keys=[constants.RUN_KEYS[0]]
    )
x, y, info = ds[0]
print(x.shape, y.shape)  # (channels,time), (time,)

Explore PNPL#

Start here

Quickstart

Install and load your first dataset run in a few lines.

Reference

API

Auto‑generated docs for classes and modules with links to source.

Tutorial

Speech Detection (LibriBrain)

Learn speech vs. silence classification with a compact walkthrough and Colab GPU.

Tutorial

Phoneme Classification (LibriBrain)

Build a phoneme recognizer on MEG with practical tips and code.

Future Plans#

While currently the primary use of the PNPL library is for the 2025 LibriBrain competition (click here to learn more!), we will maintain it for years to come and hope to turn it into a useful asset for the community. Among other things, that will mean adding:

  • More public datasets and dataset loaders

  • Easy-to-use preprocessing pipelines

  • Data augmentation options

Contribute#

We welcome issues and pull requests. See the Contributor Guide for setup and guidelines.