A Python client for OpenNeuro.
Project description
openneuro-py
A Python client for accessing OpenNeuro datasets.
Installation
# via conda:
conda install -c conda-forge openneuro-py
# or via pip:
pip install openneuro-py
Jupyter and IPython support
To get basic support for Jupyter Lab, Jupyter Notebook, IPython interactive
sessions, and VS Code's interactive Jupyter interface, you will also need to
install ipywidgets
:
# via conda:
conda install -c conda-forge ipywidgets
# or via pip:
pip install ipywidgets
Basic usage – command line interface
Getting help
openneuro-py --help
openneuro-py download --help
openneuro-py login --help
Download an entire dataset
openneuro-py download --dataset=ds000246
Specify a target directory
To 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/bids
Continue an interrupted download
Interrupted downloads will resume where they left off when you run the command again.
Advanced usage – command line interface
Exclude a directory from the download
openneuro-py download --dataset=ds000246 \
--exclude=sub-emptyroom
Download only a single file
openneuro-py download --dataset=ds000246 \
--include=sub-0001/meg/sub-0001_coordsystem.json
Note that a few essential BIDS files are always downloaded in addition.
Download or exclude multiple files
--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.jpg
Use an API token to log in
To 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 login
Paste the API key and press return.
Basic usage – Python interface
import openneuro as on
on.download(dataset='ds000246', target_dir='data/bids')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file openneuro_py-2024.2.0.tar.gz
.
File metadata
- Download URL: openneuro_py-2024.2.0.tar.gz
- Upload date:
- Size: 269.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd36ff1dd30ffc222f180552e9d9c6d2c82b631cd111b6d0be0273500ee03e31 |
|
MD5 | f2775e5d2c8d2c321bfbaf31d3a15720 |
|
BLAKE2b-256 | b34e09c14e66d05c3b8be5e6b46526157cf0e8e37fe841795099f3901e99d3c0 |
File details
Details for the file openneuro_py-2024.2.0-py3-none-any.whl
.
File metadata
- Download URL: openneuro_py-2024.2.0-py3-none-any.whl
- Upload date:
- Size: 40.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca72277914923ec4eb49a695792e8986e8f8f49d7a4cd3fdd946266ad685511c |
|
MD5 | 22497dea974a8685fb2e329933fadbe8 |
|
BLAKE2b-256 | 9f4e380ed6fe4b1001c39fff409032877c7bd8ae5745574e03ca273f7f37b2ad |