Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The command line client is installed with the Synapse Python client, therefore Python 3 is required to install the Synapse command line clientLogin to Synapse. If working on your personal computer, you may store your credentials locally by including the --rememberMe argument to allow automatic authentication with future Synapse interactions. This is recommended to prevent a case where you might accidentally share your password while sharing analytical code. In almost all cases, your Synapse API key is

To login with your username and password, e.g.

Code Block
synapse login -u <username> -p <password> --rememberMe

A Synapse access token is more secure than your password and is highly recommended to be used to login instead of using your password.

Code Block
synapse login -u <Synapse username> -p <API<access key>token> --rememberMe

From Explore Data in the portal, select the Download Options icon and Programmatic Options to visualize the command to download the data subset.

...

Install the Synapse R client synapser to download data from Synapse. Login to Synapse with your API key using your password or preferably an access token.

Code Block
languager
library(synapser)

# using password 
synLogin("my_username", "api_keypassword")

# OR using an access token
synLogin(authToken="token")

Read the exported table into R replacing Job-#### with the complete filename of the downloaded table. Create a directory to store files and download data using synGet. If downloadLocation is not specified, the files are downloaded to a hidden directory called ~/.synapseCache.

...

Install the Synapse Python client synapseclient to download data from Synapse, the pandas library to read a csv file and the os module to make a directory. Login to Synapse with your API keyusing your password or preferably an access token.

Code Block
languagepy
import synapseclient, pandas, os
syn = synapseclient.Synapse()

# login using a password
syn.login('my_username', 'api_keypassword')

# OR using an access token
syn.login(authToken='token')

Read the exported table into Python replacing Job-#### with the complete filename of the downloaded table. Create a directory to store files and download data using syn.get. If downloadLocation is not specified, the files are downloaded to a hidden directory called ~/.synapseCache.

...