Skip to main content

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qandle_ai-0.0.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qandle_ai-0.0.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

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

Hashes for qandle_ai-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4cabb5fdedbc707311fcef5d00a711902bac1c8dc2485e38e58be5bfaa0d730f
MD5 433f551e3a10706b89ddb586ec32386e
BLAKE2b-256 c108201e06dd9640df429f23564ed7af71a2e7ce4e31a8b986a0ae7aaa60d4ed

See more details on using hashes here.

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

Hashes for qandle_ai-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5ec1e05f3667a39e05584b60362478222842da2afe93ced02e92df804074291d
MD5 a68221bb672e1fd78ad6414741c6b861
BLAKE2b-256 7e3d017acb94fd37b227f037cbcfdc9f507f5b130c3799effcdd964d7e0d226e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page