Skip to main content

Quickstart

Kognic provides HTTP APIs to our client-facing services and API client libraries to simplify calling APIs from Python. kognic-auth handles authentication while kognic-io wraps basic API calls and simplifies calling the APIs from Python code. Depending on your use case, you may use one or both of these libraries. This guide will cover how install these libraries and how to set up and verify your credentials.

Installation

Installation can be done via pip:

pip install kognic-io

Note that kognic-io uses kognic-auth under the hood for authentication so you only need to install kognic-io if you plan to use it.

Setup and verify credentials

Generate and download credentials from the Kognic Platform according to this guide. Then you can set the environment variable KOGNIC_CREDENTIALS to point to it. Assuming that you saved your credentials in ~/.config/kognic/credentials.json, you can do this by running

export KOGNIC_CREDENTIALS=~/.config/kognic/credentials.json

in the terminal. To verify that they are correct you can simply list projects:

from kognic.io.client import KognicIOClient

client = KognicIOClient()
client.project.get_projects()
print("success")

You should now be set up to interact with the Kognic Platform.

Next steps