Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

waii-sdk-py

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

waii-sdk-py

Provides access to the Waii APIs

  • 1.25.5
  • PyPI
  • Socket score

Maintainers
1

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'

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc