Active Query Builder Web API

Client for Python

Download the client for Python


You can download the ready-to-use client for Python using the "Download now" link below or install the package from the public repository. Using the package will let you keep the client up-to-date. Full source code is available at GitHub.

Direct Download

Download Active Query Builder Web API Client for Python:

Download now

Install using PIP

Use PIP package manager to add Active Query Builder Web API Client to your Python project:

pip install webapi_active_query_builder
PIP package

Source code on GitHub

Download and review source code of Active Query Builder Web API Client for Python on GitHub

Source on Github
Getting started with the client for Python
Create a new API provider
api = ActiveQueryBuilderApi()
Create a new Transform object
transform = Transform()
transform.guid = "9dbd355e-360e-430e-9cca-df6dd8b6d8d1" #Metadata Guid from dashboard
transform.sql = "select id, name from Person" #Initial sql query
Add totals calculation
max = Totals()
max.field = "id"
max.aggregate = "max"

min = Totals()
min.field = "id"
min.aggregate = "min"

transform.totals = [max, min]
Define pagination
page = Pagination()
page.skip = 2
page.take = 3

transform.pagination = page
Setup sorting
asc = Sorting()
asc.field = "id"
asc.order = "asc"


desc = Sorting()
desc.field = "name"
desc.order = "desc"

transform.sortings = [asc, desc]
Apply filters
filter = ConditionGroup()

condition = Condition()
condition.field = "id"
condition.condition_operator = "Between"
condition.values = [1, 5]

filter.condition = [condition] 

transform.filter = filter
Hide some columns
column = HiddenColumn()
column.field = "name"

transform.hidden_columns = [column]
Send request to the API
result = api.transform_sql_post(transform)
transformedSql = result.sql
Get list of query columns
query = SqlQuery()
query.guid = "9dbd355e-360e-430e-9cca-df6dd8b6d8d1" #Metadata Guid from dashboard
query.text = "select id, name from Person" #Initial sql query

columns = api.get_query_columns_post(query)