Skip to main content

Trustworthy Stock Intelligence

trustworthy-stock-intelligence provides Python tools for stock drawdown-risk research. You can build features and labels, fit baseline models, evaluate predictions, and calculate uncertainty and trust scores. The package also includes leakage-aware temporal splits and Pydantic prediction schemas.

This is the Python/ML part of the Trustworthy Stock Intelligence repository. The Go API, PostgreSQL workers, TypeScript dashboard, Docker Compose stack, and market-data artifacts are not included in the wheel.

Install

python -m pip install trustworthy-stock-intelligence

Install provider and universe-ingestion support only when needed:

python -m pip install "trustworthy-stock-intelligence[data]"

Optional model/runtime groups are explicit:

python -m pip install "trustworthy-stock-intelligence[models]"
python -m pip install "trustworthy-stock-intelligence[deep]"
python -m pip install "trustworthy-stock-intelligence[db]"

The deep extra records the PyTorch dependency. For CUDA installations, follow the GPU environment guide and install the wheel index matching the target host.

Python API

from tsi import (
    add_future_drawdown_label,
    build_technical_features,
    classification_metrics,
    read_ohlcv_csv,
)
import numpy as np

ohlcv = read_ohlcv_csv("ohlcv.csv")
featured = build_technical_features(ohlcv)
labeled = add_future_drawdown_label(featured, horizon=5, threshold=-0.05)

# Future labels must be separated with a leakage-aware temporal split before
# training or evaluating a model. A metrics call receives model probabilities:
metrics = classification_metrics(
    np.array([0, 1]),
    np.array([0.10, 0.90]),
)

Top-level exports include LogisticRiskModel, TreeRiskModel, technical features, future drawdown labels, warning-level selection, calibration-aware metrics, uncertainty functions, trust scores, and Pydantic serving schemas. Ticker symbols remain strings, so values such as 0050 and 00981A retain their leading zeroes and suffixes.

CLI

The package exposes a deterministic local CLI. It reads local artifacts and does not silently call a provider or start the full application:

tsi --version
tsi inspect-csv path/to/ohlcv.csv --json
tsi evaluate predictions.csv \
  --label-column risk_label \
  --probability-column calibrated_risk_probability \
  --threshold 0.25 \
  --json

Scope and limitations

This package supports trustworthy-ML engineering and reproducible pilot research. It is not investment advice, a price-prediction guarantee, an automated trading system, or evidence of externally validated performance. Labels intentionally use future observations; temporal splitting, calibration protocols, data provenance, provider terms, and survivorship-bias limitations remain the responsibility of each experiment.

See the package guide for the full API boundary, extras, local checks, and release process. See the main README for the complete operational prototype.

Metadata

Release files for trustworthy-stock-intelligence 0.11.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trustworthy-stock-intelligence 0.11.4
File Size Uploaded Provenance Actions
trustworthy_stock_intelligence-0.11.4.tar.gz 199.0 kB With provenance Details for trustworthy_stock_intelligence-0.11.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for trustworthy-stock-intelligence 0.11.4
File Interpreter ABI Platform Actions
trustworthy_stock_intelligence-0.11.4-py3-none-any.whl Python 3 none any Details for trustworthy_stock_intelligence-0.11.4-py3-none-any.whl

Total release size: 345.0 kB

Release files / trustworthy_stock_intelligence-0.11.4.tar.gz

Download URL trustworthy_stock_intelligence-0.11.4.tar.gz
Size 199.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8f4bc48bf2057d18d4e0c704837abfe7fdb038118bff1e808d42fcb73f09e762
BLAKE2b-256 checksum
How to use checksums
392c67df6b520c5854e70bcb70725b21d55c0bdaa684d99a03b25233e155e3bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / trustworthy_stock_intelligence-0.11.4-py3-none-any.whl

Download URL trustworthy_stock_intelligence-0.11.4-py3-none-any.whl
Size 145.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
866792c3030c27dc12607c77021a547a721d39909f51333cc036f1238d5ffc72
BLAKE2b-256 checksum
How to use checksums
cec9b25edea5486eea73401ae99442f4ed465281ae2ad6460b555a881025d55d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for trustworthy-stock-intelligence 0.11.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for trustworthy_stock_intelligence-0.11.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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