Skip to main content

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_path is the path inside osfstorage (case-sensitive; use / separators).
  • save_path is treated as an output file path if it already has a suffix/extension.
  • If save_path has no suffix/extension, the tool appends one automatically:
    • project download → .zip
    • file download → uses the extension from file_path (e.g. .csv)

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_path matches 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 osfstorage provider 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

osf_downloader-0.1.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

osf_downloader-0.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

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

Hashes for osf_downloader-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ac6112dd9490b41141fe38b7499f5d4f105743ea2d727af5082c7500ba34e7da
MD5 4690d9baec9ae2560ffd4ca1a6935feb
BLAKE2b-256 cd6adb36283fe341f0ae64f79d2b7f1bf96b500e1e97461706559a0de92796f4

See more details on using hashes here.

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

Hashes for osf_downloader-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9908eb9bc1c588506e531932616621d36c2fc8a222cec5c61895d8f0da43f45e
MD5 d4b7ee947778083224a7381b3d0c63fa
BLAKE2b-256 b3b89b510eeb6b114d585c661b491fdebda41e8f0b659a32b95f93ab5e146987

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page