These instructions assume you have Python 3, pip, and a virtual environment manager installed on your computer. If you don’t, see:

Installing the Python SDK

  1. Create and activate a new Python 3 virtual environment for your SDK project (see Prerequisites above).
  2. Use pip to install the enigma-sdk package into your virtual environment.

    (venv)$ pip install enigma-sdk

To upgrade your SDK version, use:

(venv)$ pip install --upgrade enigma-sdk

Verifying the installation

To confirm that the installation was successful and your environment is set up correctly, enter the commands shown below.

(venv)$ python --version
Python 3.6.3
(venv)$ python
>>> import enigma
>>> public = enigma.Public()
>>> public.collections.list()
[<Collection 'United States'>, <Collection 'Governments'>, <Collection 'Curated Collections'>, <Collection 'Companies'>, <Collection 'Organizations'>, ...]

Confirm that your Python version is 3.x (the exact version number doesn’t matter, but the SDK will not work with Python 2.7). If the last command returns a list of collection objects (as shown above) then everything is set up correctly. Press Ctrl+d to exit the interactive Python session.