Metadata-Version: 2.4
Name: qandle-ai
Version: 0.0.1
Summary: Python SDK for Qandle AI API
Home-page: https://github.com/sillytry/doc.qandle.ai
Author: Qandle AI
Author-email: try.silly@gmail.com
Keywords: qandle ai llm stock market technical fundamental analysis data finance api sdk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.25.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Qandle AI Python SDK

A Python client for interacting with the Qandle AI API.

## Installation

Install the package from PyPI:

```bash
pip install qandle-ai
```

## Configuration

The client can be configured using environment variables:

- `QANDLE_API_KEY`: Your Qandle AI API key (required)
- `QANDLE_API_URL`: The base URL for the Qandle AI API (optional, defaults to `https://api.qandle.ai`)

## Usage

### Basic Usage

```python
from qandle_ai import QandleClient

# Initialize the client (uses QANDLE_API_KEY environment variable)
client = QandleClient()

# Get stock summary
summary = client.get("AAPL")
print(summary)
```

### Custom Configuration

```python
from qandle_ai import QandleClient

# Initialize with custom API key and base URL
client = QandleClient(
    api_key="your-api-key-here",
    base_url="https://custom-api.qandle.ai"
)

# Get stock summary
summary = client.get("TSLA")
print(summary)
```

## API Reference

### QandleClient

#### `__init__(api_key=None, base_url=None)`

Initialize the Qandle AI client.

**Parameters:**
- `api_key` (str, optional): The API key for Qandle AI. If not provided, will attempt to get from `QANDLE_API_KEY` environment variable.
- `base_url` (str, optional): The base URL for the Qandle AI API. If not provided, will use the default `https://api.qandle.ai` or `QANDLE_API_URL` environment variable.

#### `get(symbol)`

Retrieve the current action summary for a stock using the Qandle AI API.

**Parameters:**
- `symbol` (str): The stock symbol for which to obtain the current action summary.

**Returns:**
- `str`: The stock summary message or error message.

## Error Handling

The client handles various types of errors and returns descriptive error messages:

- Missing API key: Raises `ValueError` during initialization
- Network errors: Returns error message with details
- JSON parsing errors: Returns error message with details
- Other unexpected errors: Returns generic error message 
