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#
Install PNPL
pip install pnpl
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#
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.