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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trustworthy_stock_intelligence-0.4.1.tar.gz.
File metadata
- Download URL: trustworthy_stock_intelligence-0.4.1.tar.gz
- Upload date:
- Size: 116.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e78e0ec162795f51661e25f73312fdfb5fbc1dc67ac27fd8933f6c489aa1c66
|
|
| MD5 |
e720b421b3a941cf4e47db597fb36442
|
|
| BLAKE2b-256 |
3e837189860a084a94079fd678029e14c260fedc9c637683f1b1d01091987391
|
Provenance
The following attestation bundles were made for trustworthy_stock_intelligence-0.4.1.tar.gz:
Publisher:
release.yml on KageRyo/trustworthy-stock-intelligence
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trustworthy_stock_intelligence-0.4.1.tar.gz -
Subject digest:
9e78e0ec162795f51661e25f73312fdfb5fbc1dc67ac27fd8933f6c489aa1c66 - Sigstore transparency entry: 2453852078
- Sigstore integration time:
-
Permalink:
KageRyo/trustworthy-stock-intelligence@bb575f143215b9cc4321f11393c74e9ff2ac52f5 -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/KageRyo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bb575f143215b9cc4321f11393c74e9ff2ac52f5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file trustworthy_stock_intelligence-0.4.1-py3-none-any.whl.
File metadata
- Download URL: trustworthy_stock_intelligence-0.4.1-py3-none-any.whl
- Upload date:
- Size: 88.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13899fc84a1c7645cdc2b4a9387153d040a79ec0e3a3882f021e71ce0102300a
|
|
| MD5 |
4d1ad544e70830675e15e9992a5ed3bd
|
|
| BLAKE2b-256 |
5a8f2bec389e458b7d30917042fbec4df0b79b64e4348c5017a0fb693c052e76
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trustworthy_stock_intelligence-0.4.1-py3-none-any.whl -
Subject digest:
13899fc84a1c7645cdc2b4a9387153d040a79ec0e3a3882f021e71ce0102300a - Sigstore transparency entry: 2453852463
- Sigstore integration time:
-
Permalink:
KageRyo/trustworthy-stock-intelligence@bb575f143215b9cc4321f11393c74e9ff2ac52f5 -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/KageRyo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bb575f143215b9cc4321f11393c74e9ff2ac52f5 -
Trigger Event:
push
-
Statement type: