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.
Install
$ pip install peliqan
Upgrade to latest version
$ pip install peliqan --upgrade
Usage
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(pq.DW_NAME)
data = dbconn.fetch('db_name', 'schema_name', 'table_name')
print(data)
df = dbconn.fetch('db_name', 'schema_name', 'table_name', df=True)
print(df)
Argument List
The Peliqan
class takes two arguments:
- jwt (required): This is the JWT token used to authenticate requests from the client to the server. In Peliqan, see Admin > Security settings > API token.
- backend_url (optional): This is the
instance_url
that points to a specific Peliqan environment. If no value is provided, the client will look for thePELIQAN_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.
Environment Variables (optional)
- PELIQAN_URL: If this variable is set, it is not needed to set the
backend_url
parameter while instantiating the client.
Useful Links
See here to learn more about building data apps.