QAPI SDK provides a library of classes for working with Query API in your Python code.
Project description
QAPI SDK
QAPI SDK provides a library of classes for working with Query API in your Python code.
Requirements
* Python 3.6+
Installation
pip install qapi-sdk
Environment Variables
QAPI_URL
: QAPI API URLEMAIL
: Your email
Examples
Query
FEED ID
: The table must exist in Athena.QUERY ID
: The query id is used as an identifier for the query. Query id must be unique. Once you have retrieved your data from S3 it is advised to delete the query.SQL
: The SQL query to be executed.
import time
from dotenv import load_dotenv
from qapi_sdk import Query
load_dotenv()
# Step 1: Assign your FEED ID, QUERY ID, and SQL QUERY
feed_id = "[FEED/TABLE NAME]"
query_id = "[QUERY NAME]"
query = f"SELECT * FROM {feed_id}"
# Step 2: Create a Query object
my_query = Query(
feed_id=feed_id,
query_id=query_id
)
# Step 3: Execute the query push
my_query.push_query(sql=query)
# Step 4: Wait for the query to complete
while my_query.query_status():
print("Waiting for query to complete...")
time.sleep(10)
# Step 5 (Optional): Delete the query
my_query.delete_query()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qapi-sdk-0.1.3.tar.gz
(3.7 kB
view details)
Built Distribution
File details
Details for the file qapi-sdk-0.1.3.tar.gz
.
File metadata
- Download URL: qapi-sdk-0.1.3.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.4 Darwin/21.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bfa956f1451e78da0f46d20dcd2fb6a07f42b0951e08aca14267b447d400ba5 |
|
MD5 | 187b5da6596c43613038beafbdf30466 |
|
BLAKE2b-256 | b3fb32eba32fd031194024d02d51f47220e96f584b49be29056c005521668ec3 |
File details
Details for the file qapi_sdk-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: qapi_sdk-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.4 Darwin/21.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a3fe5f7377567089939593ddd79e2d394bf3bf6de2b14f23dcef49d1a33127c |
|
MD5 | 0706ca05cc1996f40b3b5f432613176b |
|
BLAKE2b-256 | e9acc26bdb0b533c8c321e67337984d45dc1ee5589902213149524e6d1f2e87f |