Pluto notebook HTML version: how to download data from repository?

Thanks! I am able to download from OSF using datahugger via PyCall. It would also be possible to call osfr via R, I haven’t tried using it from Julia, but from R it works okay (given that it’s not maintained) and allows downloading from private projects on OSF, unlike datahugger.
But I would still like to figure out how to use OSF.jl, just struggling with the API.

Yes, that would help me too (though the workaround is also okay for now).

OSF.jl is indeed not fully-documented, but see the README (Alexander Plavin / OpenScienceFramework.jl · GitLab) – it has an example of how to do basically all high-level stuff.
To get a link/download a file specifically:

using OpenScienceFramework

osf = OSF.Client(; token="YOUR TOKEN")

proj = OSF.project(osf; title="YOUR PROJECT")

# list all dirs
dirs = readdir(OSF.Directory, proj)

# list all files in the first dir
files = readdir(OSF.File, first(dirs))

# you can apply abspath/basename/... to files and dirs to see their paths and names
abspath.(files)

# obtain the URL to the first file in the list:
url = OSF.url(first(files))

# this URL can be downloaded anonymously (assuming you created at least one "view-only link" for this project):
download(url)
1 Like

Ah thank you, I hadn’t seen that. Maybe it’s recent. I will give this a try again.