Skip to main content

snowleopard.ai client library

Project description

Snow Leopard SDK for Python

Python client library for Snow Leopard Playground APIs.

Installation

pip install snowleopard

Quick Start

from snowleopard import SnowLeopardPlaygroundClient

# Initialize the client (or AsyncSnowLeopardPlaygroundClient)
client = SnowLeopardPlaygroundClient(api_key="your-api-key")

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

Getting Started

  1. Get your API key from https://auth.snowleopard.ai/account/api_keys

  2. Upload your datafiles at https://try.snowleopard.ai

  3. Set your API key via environment variable:

    export SNOWLEOPARD_API_KEY="your-api-key"
    

    Or pass it directly to the client:

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

Usage

Synchronous Client

from snowleopard import SnowLeopardPlaygroundClient

with SnowLeopardPlaygroundClient() as client:
    # Get data directly from a natural language query
    response = client.retrieve("datafile-id", "What's the total revenue?")
    print(response.data)
    
    # Stream natural language summary of live data
    for chunk in client.response("datafile-id", "Show me top 10 customers"):
        print(chunk)

Async Client

from snowleopard import AsyncSnowLeopardPlaygroundClient

async with AsyncSnowLeopardPlaygroundClient() as client:
    # Get complete results
    response = await client.retrieve("datafile-id", "What's the total revenue?")
    print(response.data)

    # Get streaming results
    async for chunk in client.response("datafile-id", "Show me top 10 customers"):
        print(chunk)

CLI

The SDK includes a command-line interface:

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

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.1.1.tar.gz (6.3 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.1.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for snowleopard-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f335f36ca472e62de2ac965f58449e5640c92f950162b8c7c40ac4d5bd8ed994
MD5 45b134b2fbf1cce1b6511ea9a8ec89cb
BLAKE2b-256 d139c6cb0656b0b0e8c0e108d64f1c46bd96ab4c4de39ed95fa105437dc6fb4c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for snowleopard-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c321b6e6ab7ff374b4d068aa77090466977928eb0903a2f3cef11a0d1093ef99
MD5 9f176d3006b8f4758938896856cd9c6e
BLAKE2b-256 5c877130a07038ef61e394662fb9a0bdc248f814e3c4aaeeb3ace2d5042c7887

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