A Python client for accessing OpenNeuro datasets.
You can run openneuro-py directly without installing it using uvx:
# Download a dataset without installing the package
uvx openneuro-py download --dataset=ds000246
# Get help
uvx openneuro-py --helpChoose one of the following methods:
# via uv (recommended):
uv add openneuro-py
# via conda:
conda install -c conda-forge openneuro-py
# via pip:
pip install openneuro-pyFor enhanced support in Jupyter Lab, Jupyter Notebook, IPython interactive
sessions, and VS Code's interactive Jupyter interface, install ipywidgets:
# via uv:
uv add ipywidgets
# via conda:
conda install -c conda-forge ipywidgets
# via pip:
pip install ipywidgetsNote: If you're using
uvxinstead of installing the package, prefix all commands below withuvx. For example,openneuro-py --helpbecomesuvx openneuro-py --help.
openneuro-py --help
openneuro-py download --help
openneuro-py login --helpopenneuro-py download --dataset=ds000246To store the downloaded files in a specific directory, use the
--target-dir switch. The directory will be created if it doesn't exist
already.
openneuro-py download --dataset=ds000246 \
--target-dir=data/bidsInterrupted downloads will resume where they left off when you run the command again.
openneuro-py download --dataset=ds000246 \
--exclude=sub-emptyroomopenneuro-py download --dataset=ds000246 \
--include=sub-0001/meg/sub-0001_coordsystem.jsonNote that a few essential BIDS files are always downloaded in addition.
--include and --exclude can be passed multiple times:
openneuro-py download --dataset=ds000246 \
--include=sub-0001/meg/sub-0001_coordsystem.json \
--include=sub-0001/meg/sub-0001_acq-LPA_photo.jpgTo download private datasets, you will need an API key that grants you access permissions. Go to OpenNeuro.org, My Account → Obtain an API Key. Copy the key, and run:
openneuro-py loginPaste the API key and press return.
import openneuro as on
on.download(dataset='ds000246', target_dir='data/bids')This project uses uv for dependency management and building.
# Clone the repository
git clone https://github.com/hoechenberger/openneuro-py.git
cd openneuro-py
# Install dependencies and create virtual environment
uv sync
# Run tests
uv run pytest
# Run the CLI during development
uv run openneuro-py --help# Build the package
uv build