Skip to main content

Snow Leopard SDK for Python

This repo contains the Python client library for Snow Leopard Playground 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?", datafile_id="your-datafile-id")

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:

    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 --datafile <datafile-id> "How many records are there?"
snowy response --datafile <datafile-id> "Summarize the data"

On Premise Customers

For our customers who have a separate deployment per dataset, you should declare explicitly when creating a client and omit 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

Metadata

Release files for snowleopard 0.3.1

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

Source distribution (sdist)

Source distribution for snowleopard 0.3.1
File Size Uploaded Provenance Actions
snowleopard-0.3.1.tar.gz 7.2 kB Without provenance Details for snowleopard-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for snowleopard 0.3.1
File Interpreter ABI Platform Actions
snowleopard-0.3.1-py3-none-any.whl Python 3 none any Details for snowleopard-0.3.1-py3-none-any.whl

Total release size: 17.5 kB

Release files / snowleopard-0.3.1.tar.gz

Download URL snowleopard-0.3.1.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
467ca6ee3fd2540991f8a1649186a9d581bcd739fc1f70aecf439ad304c82ea6
BLAKE2b-256 checksum
How to use checksums
6365eacb510f374108054b86a87741ff7e0461ba0de3a71c51c0a8322b812a73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.3

Release files / snowleopard-0.3.1-py3-none-any.whl

Download URL snowleopard-0.3.1-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
17ad6f9b3a474606d47dae681037b1d4e5002dd71b2253c81bef4fc1b00c510c
BLAKE2b-256 checksum
How to use checksums
b31ad9a33ac3232abcb6f87e4acb928c2c04effcf3d7383bd551c65908ce5ff6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.3

Security for snowleopard 0.3.1

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.

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