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 signalq.client import Client
client = Client(api_key="foobar")
client.set_api_key("foobar")

Usage

Init

from signalq.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.0.tar.gz (9.6 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.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for quantumsignals_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 28a4a906bce1506ea8ac90cc77e9db8333749ec029501c4baa0fc4929798ca53
MD5 c24c3624d27cfae4ddf4ad009db25e29
BLAKE2b-256 a52472d739d8174543ae443cc036606bc9b13d92347eb9ca29ae08a655f06aea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for quantumsignals_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae6139c6efb11801c380faa644f4ef464a45a44208dcb9de024e22514e8a27ad
MD5 9d5260590f0201a5996f4c9a966a88ec
BLAKE2b-256 4810cd3a280080683f65f7cae662cf6af2a86f19553d105977e468fd02110d57

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