Skip to content

Uploading data to Open Humans

Madeleine Price Ball edited this page Sep 23, 2016 · 3 revisions

Projects can easily return data to Open Humans members by uploading it to that member's account.

API documentation

If you're technically proficient, you may want to work with our APIs directly to download data:

Command line tools

We also have a Python package that comes with command line tools that can be used to upload data: open-humans-api

macOS Walkthrough: Upload data for project members

Here's a walkthrough of how you can use our command line tool to upload data files for a set of project members, 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.

  1. Open the "Terminal" app: All of these commands run within "Terminal". You can find the "Terminal" application within your "Utilities" folder.
  2. 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.)
  3. 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 run pip install open-humans-api.)
  4. Find your master access token in Open Humans: Follow our instructions to get your master access token. Copy the token, you'll use it in the next command.
  5. Initialize a directory (optional): Use that token to create an initial directory with all the data your project has currently stored in Open Humans. This will have subdirectories for each project member -- if you've never uploaded, these will all be empty!
  • Make the directory: mkdir MyProjectData
  • Sync data:
    ohproj-download --project-data -T YOUR_MASTER_ACCESS_TOKEN -d MyProjectData
  1. Organize the files you want to upload: There should be a subdirectory for each member ID. Put files inside these that you wish to upload to that member's account.
    (Note: Just files! No subdirectories. If you have a lot of files, you should consider packaging them as a .tar.gz first.)
  2. Draft a metadata file: ohproj-upload-metadata -d MyProjectData --create-csv MyProjectData_metadata.csv
  3. Edit this file as needed: You can use a spreadsheet editor to edit this file to add tags and descriptions. (Note: the "tags" column should be a list of comma separated strings, e.g. tag1, tag2, funny-tag, weird-tag.) Remember to save as CSV format!
  4. Upload your data: Using the updated metadata file, upload your data:
    ohproj-upload -T YOUR_MASTER_ACCESS_TOKEN --metadata-csv MyProjectData_metadata_updated.csv -d MyProjectData