Download files from osf.io
Project description
osf-downloader
Download files (or a ZIP of an entire project) from the Open Science Framework (OSF) from the command line. Useful for pulling OSF-hosted datasets into local workflows and CI pipelines.
Features
- Download an OSF project/component by ID (as a ZIP)
- Download a single file by its path inside OSF storage
- Simple CLI suitable for scripting
Install
Option A: From source (recommended for development)
git clone https://github.com/aselimc/osf-downloader.git
cd osf-downloader
# editable install
pip install -e .
Option B: Python package (if published)
pip install osf-downloader
Requirements:
- Python 3.9+
Usage
The installed CLI entrypoint is osf-download.
Replace
<OSF_ID>with your OSF project or component id (the short code in the OSF URL).
osf-download download <OSF_ID> ./data
Download a single file by path inside OSF storage:
osf-download download <OSF_ID> ./data/myfile.csv path/inside/osf/myfile.csv
Notes:
- Command shape:
osf-download download PROJECT_ID SAVE_PATH [FILE_PATH]. file_pathis the path inside osfstorage (case-sensitive; use/separators).save_pathis treated as an output file path if it already has a suffix/extension.- If
save_pathhas no suffix/extension, the tool appends one automatically:- project download →
.zip - file download → uses the extension from
file_path(e.g..csv)
- project download →
Examples
Download an OSF project ZIP to ./datasets/osf.zip:
osf-download download abcd1 ./datasets/osf.zip
Download an OSF project ZIP where the .zip extension is chosen automatically:
osf-download download abcd1 ./datasets/osf
Download a single file into ./datasets/:
osf-download download abcd1 ./datasets results/data.csv
Tip: to avoid ambiguity, prefer providing a full output filename (e.g. ./datasets/results.csv).
Troubleshooting
- 404 / not found: verify the OSF id and that the project/component is public.
- 401 / unauthorized: this tool currently does not handle OSF authentication; use public resources.
- Path not found: if downloading a single file, ensure
file_pathmatches the OSF storage path (case-sensitive).
Caveats
- Project downloads create a ZIP by fetching all files; for very large projects this may take time and memory.
- Only the
osfstorageprovider is supported.
Contributing
Issues and pull requests are welcome. Include:
- A clear description of the OSF resource and expected behavior
- Minimal reproduction steps
- Logs/trace output if available
License
MIT. See LICENSE.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file osf_downloader-0.1.0.tar.gz.
File metadata
- Download URL: osf_downloader-0.1.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac6112dd9490b41141fe38b7499f5d4f105743ea2d727af5082c7500ba34e7da
|
|
| MD5 |
4690d9baec9ae2560ffd4ca1a6935feb
|
|
| BLAKE2b-256 |
cd6adb36283fe341f0ae64f79d2b7f1bf96b500e1e97461706559a0de92796f4
|
File details
Details for the file osf_downloader-0.1.0-py3-none-any.whl.
File metadata
- Download URL: osf_downloader-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9908eb9bc1c588506e531932616621d36c2fc8a222cec5c61895d8f0da43f45e
|
|
| MD5 |
d4b7ee947778083224a7381b3d0c63fa
|
|
| BLAKE2b-256 |
b3b89b510eeb6b114d585c661b491fdebda41e8f0b659a32b95f93ab5e146987
|