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:
- kognic-io
- kognic-auth
pip install kognic-io
pip install kognic-auth
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:
- kognic-io
- kognic-auth
from kognic.io.client import KognicIOClient
client = KognicIOClient()
client.project.get_projects()
print("success")
import requests
from kognic.auth.requests.auth_session import RequestsAuthSession
client = RequestsAuthSession()
client.session.get("https://input.app.kognic.com/v1/projects").raise_for_status()
print("success")
You should now be set up to interact with the Kognic Platform.
Next steps
- Upload your first scene: Quick guide on how to upload data to the Kognic Platform
- Key concepts: Learn about the key concepts of the Kognic Platform