Python SDK for Qandle AI API
Project description
Qandle AI Python SDK
A Python client for interacting with the Qandle AI API.
Installation
Install the package from PyPI:
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 tohttps://api.qandle.ai)
Usage
Basic Usage
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
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 fromQANDLE_API_KEYenvironment variable.base_url(str, optional): The base URL for the Qandle AI API. If not provided, will use the defaulthttps://api.qandle.aiorQANDLE_API_URLenvironment 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
ValueErrorduring initialization - Network errors: Returns error message with details
- JSON parsing errors: Returns error message with details
- Other unexpected errors: Returns generic error message
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qandle_ai-0.0.1.tar.gz.
File metadata
- Download URL: qandle_ai-0.0.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cabb5fdedbc707311fcef5d00a711902bac1c8dc2485e38e58be5bfaa0d730f
|
|
| MD5 |
433f551e3a10706b89ddb586ec32386e
|
|
| BLAKE2b-256 |
c108201e06dd9640df429f23564ed7af71a2e7ce4e31a8b986a0ae7aaa60d4ed
|
File details
Details for the file qandle_ai-0.0.1-py3-none-any.whl.
File metadata
- Download URL: qandle_ai-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ec1e05f3667a39e05584b60362478222842da2afe93ced02e92df804074291d
|
|
| MD5 |
a68221bb672e1fd78ad6414741c6b861
|
|
| BLAKE2b-256 |
7e3d017acb94fd37b227f037cbcfdc9f507f5b130c3799effcdd964d7e0d226e
|