Skip to main content

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 to https://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 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

Metadata

Release files for qandle-ai 0.0.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 qandle-ai 0.0.1
File Size Uploaded
qandle_ai-0.0.1.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for qandle-ai 0.0.1
File Interpreter ABI Platform
qandle_ai-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.0 kB

Release files / qandle_ai-0.0.1.tar.gz

Download URL qandle_ai-0.0.1.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4cabb5fdedbc707311fcef5d00a711902bac1c8dc2485e38e58be5bfaa0d730f
BLAKE2b-256 checksum
How to use checksums
c108201e06dd9640df429f23564ed7af71a2e7ce4e31a8b986a0ae7aaa60d4ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.6

Release files / qandle_ai-0.0.1-py3-none-any.whl

Download URL qandle_ai-0.0.1-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ec1e05f3667a39e05584b60362478222842da2afe93ced02e92df804074291d
BLAKE2b-256 checksum
How to use checksums
7e3d017acb94fd37b227f037cbcfdc9f507f5b130c3799effcdd964d7e0d226e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.6

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

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