Skip to main content

Provides access to the Waii APIs

Project description

Waii Python SDK

The waii-sdk-py is a Python library that allows you to interact with the Waii API. It provides a powerful SQL and AI capability to your Python applications.

Installation

To install the waii-sdk-py, you can use pip:

pip install waii-sdk-py

Importing & Initialize the SDK

>>> from waii_sdk_py import WAII
>>> from waii_sdk_py.query import *
>>> WAII.initialize(api_key="<your-api-key>")

You can get your API key from the tweakit.waii.ai (You need to register and get access from waii.ai first).

img.png

Get started

First you can print the list of available databases:

>>> print([conn.key for conn in WAII.Database.get_connections().connectors])

Then, you can activate the database connection you want to use (from one of the key in the list above)

>>> WAII.Database.activate_connection("snowflake://...&warehouse=COMPUTE_WH")

Get Database name of the active connection

>>> print([catalog.name for catalog in WAII.Database.get_catalogs().catalogs])
>>> print(WAII.Query.generate(QueryGenerationRequest(ask = "How many tables are there?")).query)

SELECT COUNT(DISTINCT table_name)
FROM waii.information_schema.tables

Run the query

>>> print(WAII.Query.run(RunQueryRequest(query = "SELECT COUNT(DISTINCT table_name) FROM waii.information_schema.tables")))

rows=[{'COUNT(DISTINCT TABLE_NAME)': 112}] more_rows=0 column_definitions=[ColumnDefinition(name='COUNT(DISTINCT TABLE_NAME)', type='FIXED')] query_uuid='01afbd1e-0001-d31e-0022-ba8700a8209e'

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

waii_sdk_py-1.13.3.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

waii_sdk_py-1.13.3-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file waii_sdk_py-1.13.3.tar.gz.

File metadata

  • Download URL: waii_sdk_py-1.13.3.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for waii_sdk_py-1.13.3.tar.gz
Algorithm Hash digest
SHA256 e016619d5ed39a82e99989080a398b3e70254e4e1f6159db1ba9ca29ccf63007
MD5 a178b7f9acd303a53b0966c5f154748c
BLAKE2b-256 f58d0bd75718bea4929f6dbb6953f944df810a7b0941c1b9faaa1419815fe395

See more details on using hashes here.

File details

Details for the file waii_sdk_py-1.13.3-py3-none-any.whl.

File metadata

  • Download URL: waii_sdk_py-1.13.3-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for waii_sdk_py-1.13.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e2b49915936adac5c06d7feff9fa5fb62c2d4838ad15b2d247449f876a8576f9
MD5 8372046bf878c985ab79db4cc4539391
BLAKE2b-256 4a6972929ff7f08646ae1d9f2e087ccd87df756c3f20f160fa098bdcb4dc9b9b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page