Metadata-Version: 2.4
Name: snowleopard
Version: 0.1.1
Summary: snowleopard.ai client library
Author-email: Snowy <hello@snowleopard.ai>
License: MIT License
        
        Copyright (c) 2025 Snow Leopard AI
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Requires-Python: >=3.8
Requires-Dist: httpx>=0.28.1
Description-Content-Type: text/markdown

# Snow Leopard SDK for Python

Python client library for [Snow Leopard Playground](https://try.snowleopard.ai) APIs.

## Installation

```bash
pip install snowleopard
```

## Quick Start

```python
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](https://auth.snowleopard.ai/account/api_keys)
2. **Upload your datafiles** at [https://try.snowleopard.ai](https://try.snowleopard.ai)
3. **Set your API key** via environment variable:
    ```bash
    export SNOWLEOPARD_API_KEY="your-api-key"
    ```
    
    Or pass it directly to the client:
    
    ```python
    SnowLeopardPlaygroundClient(api_key="your-api-key")
    ```

## Usage

### Synchronous Client

```python
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

```python
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:

```bash
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](CONTRIBUTING.md)
