Skip to main content

snowleopard.ai client library

Project description

Snow Leopard SDK for Python

This repo contains the Python client library for Snow Leopard APIs.

See our API documentation for more details.

Installation

pip install snowleopard

Quick Start

from snowleopard import SnowLeopardClient

# Initialize the client (or AsyncSnowLeopardClient)
client = SnowLeopardClient(api_key="your-api-key")

# Query your data in natural language
response = client.retrieve(user_query="How many users signed up last month?", instance_id="your-instance-id")

Getting Started

  1. Try Snow Leopard here https://cloud.snowleopard.ai

  2. Set your API key via environment variable:

    export SNOWLEOPARD_API_KEY="your-api-key"
    

    Or pass it directly to the client:

    SnowLeopardClient(api_key="your-api-key")
    

Usage

Synchronous Client

from snowleopard import SnowLeopardClient

with SnowLeopardClient() as client:
   # Get data directly from a natural language query
   response = client.retrieve(user_query="How many superheroes are there?")
   print(response.data)

   # Stream natural language summary of live data
   for chunk in client.response(user_query="How many superheroes are there?"):
      print(chunk)

Async Client

from snowleopard import AsyncSnowLeopardClient

async with AsyncSnowLeopardClient() as client:
   # Get complete results
   response = await client.retrieve(user_query="How many superheroes are there?")
   print(response.data)

   # Get streaming results
   async for chunk in client.response(user_query="How many superheroes are there?"):
      print(chunk)

CLI

The SDK includes a command-line interface:

pip install snowleopard
snowy retrieve --instance <instance-id> "How many records are there?"
snowy response --instance <instance-id> "Summarize the data"

On-Premises Customers

For our customers who have a separate deployment per dataset, you should declare explicitly when creating a client and omit <instance_id> when querying.

Example:

client = SnowLeopardClient(url="https://{your-vm-ip}:{port}", api_key="your-api-key")
response = client.retrieve(user_query="How many users signed up last month?")

Contributing

For SDK developer docs and how to contribute, see CONTRIBUTING.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snowleopard-0.4.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

snowleopard-0.4.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file snowleopard-0.4.0.tar.gz.

File metadata

  • Download URL: snowleopard-0.4.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for snowleopard-0.4.0.tar.gz
Algorithm Hash digest
SHA256 e8977cbbbf640d25c0571553a8ba1bdf86bdd4c4c77588e99a4cdc965df93ae8
MD5 096a368330ea9712acedabd320babb91
BLAKE2b-256 48d5ac944d226d90755971d7e81b6db6ce5ea6ba335a6e624721416bcc87c68e

See more details on using hashes here.

File details

Details for the file snowleopard-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: snowleopard-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for snowleopard-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae929b19188eba0741ad1e1d10552747c1e6811ca4950957f755b38b7c55d42f
MD5 7095082a35e2a452ed7341b0f98683c9
BLAKE2b-256 cbba93b7d60fddb97b804f47e0bfc1d880dc9d8eb30363aec62a4ee330b05b71

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