A Python module to connect to a Peliqan environment from a Python script running anywhere outside of the Peliqan environment. This module is a wrapper for the public Peliqan REST APIs.
$ pip install peliqan
$ pip install peliqan --upgrade
from peliqan import Peliqan
jwt = "MY_JWT_TOKEN" # see Admin > Security settings > API token
backend_url="MY_PELIQAN_URL" # optional, default: *<https://app.eu.peliqan.io/*>
pq = Peliqan(jwt, backend_url)
# Example usage
dbconn = pq.dbconnect('dw_123')
data = dbconn.fetch('db_name', 'schema_name', 'table_name')
print(data)
df = dbconn.fetch('db_name', 'schema_name', 'table_name', df=True)
print(df)
The Peliqan
class takes two arguments:
instance_url
that points to a specific Peliqan environment. If no value is provided, the client will look for the PELIQAN_URL
environment variable. If it is not set, then the value defaults to *https://app.eu.peliqan.io/*.More info on the Peliqan environment URL and JWT token here.
backend_url
parameter while instantiating the client.See here to learn more about building data apps.