Skip to main content

Python client for Quantum Signals APIs (streaming, inference, key management, backtest)

Project description

Quantum Signals Client

Python client library for Quantum Signals APIs.

Overview

This package provides a Python client for interacting with Quantum Signals services:

  • Streaming: SSE-based signal streaming
  • Inference: Model catalog and prediction endpoints
  • Key Management: API key CRUD operations
  • Backtest: Backtest results and metadata

Configuration

The client reads configuration from environment variables:

# Required:
export QUANTUMSIGNALS_API_KEY=foobar
# Optional, defaults to production URL:
export QUANTUMSIGNALS_BASE_URL=http://localhost:8000

The API key can also be set explicitly:

from quantumsignals.client import Client
client = Client(api_key="foobar")
client.set_api_key("foobar")

Usage

Init

from quantumsignals.client import Client
client = Client()

Fetching Available Models

models = client.get_model_catalog()

Streaming Signals

# Stream real-time signals via SSE
for signal in client.stream_signals():
    print(f"{signal.time} | {signal.symbol}: {signal.signal}")

Backtest Operations

# Get most recent backtest for a model/symbol
backtest = client.get_most_recent_backtest(
    model_hash="abc123",
    symbol="AAPL"
)

# Get backtest metadata
metadata = client.get_backtest_metadata(backtest_id="uuid")

# Get backtest results (JSON, CSV, or Parquet)
results = client.get_backtest_results(
    backtest_id="uuid",
    format="json",
    page=1,
    page_size=100
)

# Get accuracy metrics
accuracy = client.get_backtest_accuracy(
    backtest_id="uuid",
    format="json"
)

Context Manager Usage

# Properly close HTTP connections
with Client() as client:
    client.login()
    models = client.get_model_catalog()
    # Client automatically closes on exit

Development

This is a workspace package in the QS1 monorepo. See the main repository README for development setup.

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

quantumsignals_client-0.2.1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

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

quantumsignals_client-0.2.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file quantumsignals_client-0.2.1.tar.gz.

File metadata

File hashes

Hashes for quantumsignals_client-0.2.1.tar.gz
Algorithm Hash digest
SHA256 146d24848d70f179e3bff105a1ef4085754dd573eb56257fbc15b1973774c3cf
MD5 557bf2b5bba4e3525b690f9cdbec4010
BLAKE2b-256 c3f4d2534deeaa27e82e940eacd66ec57caf48bcec1eec1704a6eeac2e72ca03

See more details on using hashes here.

File details

Details for the file quantumsignals_client-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for quantumsignals_client-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 69013de48003dec7699ee70e0be4e69709302b78a69629e5ff08e5ae85b7e86e
MD5 66984c246d01db09fd2ba3d85e5d8ad7
BLAKE2b-256 1c76a2d0a1ce54b07a4660120e934c9ff3835040feaed48e94f7710c6ff3cbf3

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