Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

download_osf.sh - Download files from Open Science Framework (OSF) projects

Description

This script downloads all files and directories from an OSF project using the osfclient command-line tool. It’s designed for replication workflows where researchers need to download datasets, code, and other materials from OSF repositories for analysis and verification.

Usage

./download_osf.sh <OSF_DOI_OR_PROJECT_ID>
bash tools/download_osf.sh <OSF_DOI_OR_PROJECT_ID>

Arguments

Examples

# Using project ID directly
./download_osf.sh abc12

# Using full OSF URL
./download_osf.sh https://osf.io/abc12/

# Using OSF DOI
./download_osf.sh 10.17605/OSF.IO/ABC12

Requirements

Features

Behavior

Output Structure

Input: abc12 (or https://osf.io/abc12/ or DOI)
Output directory: ./osf-abc12/
Contents: Complete OSF project structure with all files and subdirectories

Error Handling

Dependencies

osfclient installation:

pip install osfclient
# or
pip install -r requirements.txt  # if included in project requirements

OSF API

How It Works

  1. Input Parsing: Extracts project ID from URLs, DOIs, or direct IDs

  2. Validation: Checks for osfclient installation and valid arguments

  3. Directory Creation: Creates organized output directory

  4. Download: Uses osfclient’s clone command to download entire project

  5. Organization: Maintains original OSF project structure

Authentication

For private OSF projects, you may need to set up authentication:

osf auth

This tool is essential for reproducible research workflows that rely on datasets and materials hosted in OSF repositories.