Skip to main content

Python SDK getting started

The CloudQuant Data Liberator Python SDK provides the simplest way to query and work with CloudQuant datasets from any Python environment.

Prerequisites

  • Python 3

Installation

Install the third-party dependencies Liberator needs. The liberator.py client itself is not on PyPI — download it from your Liberator Profile page (see Required security files below).
conda create -n liberator python=3.7
conda activate liberator
conda install -c anaconda requests pyopenssl cryptography six pytz
conda install pandas
conda install -c conda-forge httpx async_generator pyarrow=8.0.0

Required security files

You need the following files from your Downloads ZIP file:
  • liberator.py — The CloudQuant Data Liberator API for Python
  • liberator.json — Contains your Username and Token
  • liberator.pfx — Security certificate (only required for releases prior to 2.0)
Place liberator.py in the same folder as your code or in your Python site-packages directory. Place liberator.json (and liberator.pfx if needed) in your working directory, or set explicit paths before querying:
import liberator

liberator.auth = '/path/to/liberator.json'
liberator.pfx = '/path/to/liberator.pfx'  # releases prior to 2.0 only
liberator.json is resolved from your working directory unless you set liberator.auth.
As of release version 2.0, liberator.pfx is no longer required. If you are on a release prior to 2.0, you must also include liberator.pfx in your working directory.
When using Jupyter Notebooks, set the working directory to the location containing liberator.json (and liberator.pfx if you are on a release prior to 2.0). See this reference for changing the Jupyter Notebook startup folder on Windows.

Optional: CloudQuant charting

If using CloudQuant Charting (included with the API), install these additional packages:
conda install plotly numpy
conda install -c conda-forge ta-lib
TA-Lib on pip requires the ta-lib C library to be installed first. Conda installs both the library and Python bindings together.

Quick start

import liberator

df = liberator.get_dataframe(
    liberator.query(
        name='daily_bars',
        as_of='2020-11-15',
        symbols=['AAPL']
    )
)

print(df)