pybids
bids: interface with datasets conforming to BIDS
What it is and what it does
PyBIDS is a Python library that centralizes interactions with brain imaging datasets formatted according to the BIDS standard. It provides tools to query, validate, and programmatically access neuroimaging data organized in the standardized BIDS layout, eliminating the need to manually navigate directory structures and file naming conventions.
The package wraps core neuroimaging tools (numpy, scipy, nibabel, pandas) and integrates with bids-validator to ensure dataset compliance. It supports Python 3 on POSIX systems (Linux, macOS) and is actively maintained by the BIDS community. Installation brings in 12 runtime dependencies by default, though core querying functionality requires only the bids-validator package.
Use it for:
- Query and retrieve specific imaging files from a BIDS dataset by subject, session, task, or modality without manual directory traversal.
- Validate that a neuroimaging dataset conforms to BIDS specification before analysis or sharing.
- Programmatically access metadata and file paths for batch processing of imaging data in research pipelines.
- Generate reports on dataset structure and contents using the reports module.
- Integrate BIDS dataset access into Python-based neuroimaging analysis workflows alongside nibabel and scipy.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyBIDS provides a Python interface to query, validate, and interact with neuroimaging datasets that conform to the BIDS (Brain Imaging Data Structure) standard format.
Yes. PyBIDS is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and solves a concrete problem for neuroimaging researchers working with BIDS-formatted data. Low install friction makes it a safe choice. Install only if you work with BIDS datasets; it is not a general-purpose tool.
Install
pybids on PyPI
pip
pip install pybidsuv
uv add pybidspoetry
poetry add pybidsInstalling pybids
Before you install
Low install friction with a pure-Python wheel and active maintenance. Last release was 155 days ago with an active repository (263 stars, last commit 2026-08-04). Requires Python 3.10 or later.
License in practice
MIT License (permissive) permits commercial and private use, modification, and distribution with minimal restrictions—only requiring attribution and inclusion of the license notice.
Quickstart
pip install pybids
from bids import BIDSLayout
layout = BIDSLayout('/path/to/bids/dataset')
subjects = layout.get_subjects()
Requires Python 3.10 or later; Windows is not officially supported though most functionality may work.
Verify before relying
- Whether all 12 runtime dependencies are always required or only for specific modules.
- Performance characteristics when working with very large BIDS datasets.
- Current state of Windows compatibility despite official non-support claim.
Package facts
| License | The MIT License (MIT) Copyright (c) 2015-2016, Ariel Rokem, The University of Washington eScience Institute. Copyright (c) 2016--, PyBIDS developers, Planet Earth Permission is hereby granted, free… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 12 — numpy, scipy, nibabel, pandas, formulaic, sqlalchemy, bids-validator, bidsschematools, num2words, click, universal_pathlib, frozendict |
| Maintenance | actively maintained — 155 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 136,311/month — #11,399 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pybids-0.22.0-py3-none-any.whl
Keywords: BIDS, neuroimaging
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
bids-validatorValidates that brain imaging datasets conform…
permissive · top 15,000 on PyPI
bidsschematoolsParse, validate, and export the Brain Imaging…
permissive · top 15,000 on PyPI
nilearnNilearn provides statistical and…
permissive · top 15,000 on PyPI
pyxnatpyxnat provides Python bindings to interact…
permissive · top 15,000 on PyPI
mne-bidsMNE-BIDS reads and writes neuroimaging datasets…
permissive · top 15,000 on PyPI
dipyDIPY is a Python library for analyzing…
permissive · top 15,000 on PyPI
nibabelNiBabel reads and writes neuroimaging file…
permissive · top 5,000 on PyPI
nipypeNipype provides a uniform Python interface to…
permissive · top 15,000 on PyPI
dicom2niftiConverts DICOM medical imaging files to NIfTI…
permissive · top 15,000 on PyPI
dicomweb-clientA Python client library for interacting with…
permissive · top 15,000 on PyPI