-
Notifications
You must be signed in to change notification settings - Fork 22
Downloading data shared with your project
When members join and authorize your project, they authorize ongoing sharing to the list of data sources your project has requested. This access is ongoing: your project will always have access to the current version of data from this source. This means the project receives access to updated data without needing to perform re-authorization.
If you're technically proficient, you may want to work with our APIs directly to download data:
We also have a Python package that comes with a command line tool that can be used to download data: open-humans-api
Here's a walkthrough of how you can use our command line tool to download all data files currently shared with your project, using the Apple macOS operating system.
Note: if you're proficient with Python, you might want to be using brew and virtualenv to "sandbox" the installed software. The instructions below install packages "globally". See this guide for macOS development setup.
- Open the "Terminal" app: All of these commands run within "Terminal". You can find the "Terminal" application within your "Utilities" folder.
-
Install pip: If you don't already have pip installed, you can install it by running this command in Terminal:
sudo easy_install pip
(Unnecessary if using brew.) -
Install open-humans-api: You can install our package globally by running this in Terminal:
sudo pip install open-humans-api
.
(If using brew and/or virtualenv, you should avoid global installation and just runpip install open-humans-api
.) (Later, to update to future versions, you can usesudo pip install open-humans-api --upgrade
) -
Navigate to your Desktop:
cd ~/Desktop
-
Create a directory to put your data:
mkdir MyProjectData
-
Use a project master access token to download data: Copy and paste the following command into Terminal. (Note: all of this should be on a single line.) This uses a "demo" project token. It should download data for a single project member:
ohproj-download -T XitlFDXBqm5TRK8Vuh3Ey2cDFdiTWz7amKpot97H9Xfgak1qpvray0b0arQhvpEP -d MyProjectData
- If you substitute in your project's token, the above command will download ALL user files to MyProjectData.
- You can also download individual member data by adding
-m 12345678
(where 12345678 is the member ID) in the command. The full command, for example, would beohproj-download -T XitlFDXBqm5TRK8Vuh3Ey2cDFdiTWz7amKpot97H9Xfgak1qpvray0b0arQhvpEP -m 12345678 -d MyProjectData
- You can also create a whitelist of member data to pull, using the
--memberlist TEXTFILE.txt
option before your-d MyProjectData
; similarly, you can exclude a set of data by using--excludelist TEXTFILE.txt
. - (See this page for other tips on pulling data from a project).
-
You can also download a metadata CSV: If you don't want the files, just some information about them.
ohproj-download-metadata -T XitlFDXBqm5TRK8Vuh3Ey2cDFdiTWz7amKpot97H9Xfgak1qpvray0b0arQhvpEP --output-csv MyProjectMetadata.csv
- Find your own master access token: To download data for your own project's members, you'll need to follow our instructions to get your master access token.
-
More options: Learn about more options by running
ohproj-download --help
Unless you're performing a member-specific download, directories will be created for each project member ID. Also, unless a source is specified, all shared sources are downloaded and data is sorted into subdirectories according to source.