Skip to main content

Trustworthy Stock Intelligence

trustworthy-stock-intelligence is a Python package for leakage-aware stock drawdown-risk research. It provides reusable feature, labeling, baseline-model, evaluation, uncertainty, trust-score, and serving-schema primitives.

This distribution is the Python/ML core of the larger Trustworthy Stock Intelligence repository. The Go API, PostgreSQL workers, TypeScript dashboard, Docker Compose stack, and market-data artifacts are separate surfaces and are not included in this 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.

Download files

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

Source Distribution

trustworthy_stock_intelligence-0.4.1.tar.gz (116.1 kB view details)

Uploaded Source

Built Distribution

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

trustworthy_stock_intelligence-0.4.1-py3-none-any.whl (88.2 kB view details)

Uploaded Python 3

File details

Details for the file trustworthy_stock_intelligence-0.4.1.tar.gz.

File metadata

File hashes

Hashes for trustworthy_stock_intelligence-0.4.1.tar.gz
Algorithm Hash digest
SHA256 9e78e0ec162795f51661e25f73312fdfb5fbc1dc67ac27fd8933f6c489aa1c66
MD5 e720b421b3a941cf4e47db597fb36442
BLAKE2b-256 3e837189860a084a94079fd678029e14c260fedc9c637683f1b1d01091987391

See more details on using hashes here.

Provenance

The following attestation bundles were made for trustworthy_stock_intelligence-0.4.1.tar.gz:

Publisher: release.yml on KageRyo/trustworthy-stock-intelligence

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trustworthy_stock_intelligence-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for trustworthy_stock_intelligence-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 13899fc84a1c7645cdc2b4a9387153d040a79ec0e3a3882f021e71ce0102300a
MD5 4d1ad544e70830675e15e9992a5ed3bd
BLAKE2b-256 5a8f2bec389e458b7d30917042fbec4df0b79b64e4348c5017a0fb693c052e76

See more details on using hashes here.

Provenance

The following attestation bundles were made for trustworthy_stock_intelligence-0.4.1-py3-none-any.whl:

Publisher: release.yml on KageRyo/trustworthy-stock-intelligence

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.4.2

2 files

This release

0.4.1 This release

2 files

Supported by

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