BIDS Validator
raw JSON → 1.14.7.post0 verified Mon Apr 27 auth: no python maintenance
The BIDS Validator checks that a dataset directory conforms to the Brain Imaging Data Structure (BIDS) specification. It reports errors, warnings, and suggestions. The current PyPI version is 1.14.7.post0 (a legacy version); the actively developed JavaScript/Node version is 2.4.1. The Python package is a wrapper around the Node.js validator and is in maintenance mode. Release cadence is irregular.
pip install bids-validator Common errors
error ModuleNotFoundError: No module named 'bids-validator' ↓
cause Attempting to import with a hyphen instead of an underscore.
fix
Run 'import bids_validator' (or 'from bids_validator import BIDSValidator').
error bids-validator: command not found ↓
cause The pip install does not install an executable named 'bids-validator' on all platforms, or the PATH is not set properly.
fix
After pip install, try 'python -m bids_validator' or install the Node.js version via npm.
error Error: Cannot find module 'bids-validator' ↓
cause The Node.js validator is not installed when using the Python package, or the wrong version is installed.
fix
Ensure Node.js is installed and run 'npx bids-validator' or 'npm install -g bids-validator'.
Warnings
deprecated The Python package (PyPI) is a legacy wrapper around an older version of the Node.js validator. The actively developed version is the Node.js package (npm). New features and schema updates are only available in the Node.js version. ↓
fix Use the Node.js validator by running 'bids-validator' via npx or install the npm package. For Python-only workflows, consider using the 'bids-validator' command-line tool installed with pip, but expect limited updates.
gotcha The Python package 'bids-validator' is imported as 'bids_validator' (underscore), not the hypenated name. Many users mistakenly try 'from bids-validator import ...' which causes a syntax error. ↓
fix Use 'from bids_validator import BIDSValidator'.
gotcha The Python package requires Node.js to be installed. If Node.js is missing, the validator will fail with an obscure error or silently not work. ↓
fix Install Node.js (>=12) from https://nodejs.org/ or via your package manager.
breaking Between version 1.x and 2.x of the node package (which the Python wrapper does not match), the API changed significantly. The Python package is pinned to an older schema version and may not validate datasets following newer BIDS specification versions. ↓
fix Use the Node.js version for full BIDS schema support (v1.11.x). For Python, consider other tools like 'pybids' for programmatic access.
Imports
- BIDSValidator
from bids_validator import BIDSValidator
Quickstart
from bids_validator import BIDSValidator
validator = BIDSValidator()
# Validate a dataset directory
result = validator.validate('/path/to/dataset')
# Iterate over issues
for issue in result['issues']:
print(issue['severity'], issue['key'], issue['message'])