Skip to content

Getting Started

Install Polly Python using pip

pip install polly-python

Import from libraries

The following libraries need to be imported over the development environment to access the data.

from polly.auth import Polly
from polly.omixatlas import OmixAtlas
from polly.workspaces import Workspaces
from polly.cohort import Cohort
from import jobs


Authentication of the account is required to be able to access the capabilities of the Polly Python library.

Copying Polly API KEY from GUI

To get Polly API KEY, follow the steps below:

  1. Go to Polly

  2. Click the User Options icon from the left-most panel

  3. Click on Authentication on the panel that appears

  4. Click on Copy to copy the authentication key

Using Polly API Keys

Run this code to authenticate using Polly API KEY and start using polly-python.

import os
from polly.auth import Polly
AUTH_KEY = `Paste the API key copied from your Polly account as a string.`

Calling a function

In order to call a functions from a particular class, corresponding object should be defined.

E.g. for functions related to OmixAtlas,

omixatlas = OmixAtlas()
output = omixatlas.<function_name>(<args if any>)
Similarly, for functions related to Workspaces,
workspaces = Workspaces()
output = workspaces.=<function_name>(<args if any>)
And, for functions related to Cohorts,

cohort = Cohort()
output = cohort.<function_name>(<args if any>)

For example,

omixatlas = OmixAtlas()
result = omixatlas.query_metadata(<sql_query>)

Get installed version of polly-python

import polly