Skip to main content

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

Waii Python SDK depends on pydantic, but to avoid it conflicting with other libraries, it is not included in the dependencies. You can install it separately:

You can either install v1.10.15+

pip install pydantic==1.10.15

Or 2.7.1+

pip install pydantic==2.7.1

Importing & Initialize the SDK

>>> from waii_sdk_py import WAII
>>> from waii_sdk_py.query import *
>>> WAII.initialize(api_key="<your-api-key>")
>>> print(WAII.version()) # Check the version of the SDK

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'

Metadata

Release files for waii-sdk-py 1.30.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for waii-sdk-py 1.30.0
File Size Uploaded Provenance Actions
waii_sdk_py-1.30.0.tar.gz 40.4 kB Without provenance Details for waii_sdk_py-1.30.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for waii-sdk-py 1.30.0
File Interpreter ABI Platform Actions
waii_sdk_py-1.30.0-py3-none-any.whl Python 3 none any Details for waii_sdk_py-1.30.0-py3-none-any.whl

Total release size: 93.9 kB

Release files / waii_sdk_py-1.30.0.tar.gz

Download URL waii_sdk_py-1.30.0.tar.gz
Size 40.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4dddea89cbe3bed53a01e0a460d02102d58dc19967c7dc5ed93820a278d3a973
BLAKE2b-256 checksum
How to use checksums
52090f17b77c34840dc3b288d1c514a57fc702bd6f0e613fad3cf292db5cb825
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / waii_sdk_py-1.30.0-py3-none-any.whl

Download URL waii_sdk_py-1.30.0-py3-none-any.whl
Size 53.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa4bed001079275ba30dcbabfd87c5241ba35fb17f1bbf3c04b5c3009f0c6636
BLAKE2b-256 checksum
How to use checksums
2ab0f350838e0cbbabdecab5484590c30adb2dc3ab03cd78b0bb0043e87b9a9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for waii-sdk-py 1.30.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.30.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page