Skip to main content

The Snapshot Vault for XRTM.

Project description

xrtm-data

License Python PyPI

The Snapshot Vault for XRTM.

xrtm-data provides the rigid schemas and temporal sandboxing infrastructure required for zero-leakage forecasting. It defines the "Ground Truth" data structures that the rest of the ecosystem (Forecast, Eval, Train) relies on.

Part of the XRTM Ecosystem

Layer 4: xrtm-train    → (imports all)
Layer 3: xrtm-forecast → (imports eval, data)
Layer 2: xrtm-eval     → (imports data)
Layer 1: xrtm-data     → (zero dependencies) ← YOU ARE HERE

xrtm-data is the foundation layer with zero dependencies on other xrtm packages.

Installation

pip install xrtm-data

Core Primitives

1. The Forecast Object Standard

Adhering to strict Governance v1, the ForecastOutput schema mandates that every prediction be accompanied by a structured causal graph (logical_trace) and a calibrated confidence interval.

from xrtm.data import ForecastOutput, CausalNode

prediction = ForecastOutput(
    question_id="q_123",
    probability=0.75,
    reasoning="Base rate analysis suggests...",
    logical_trace=[
        CausalNode(event="Inflation rises", probability=0.8),
        CausalNode(event="Fed cuts rates", probability=0.4)
    ]
)

2. Zero Leakage

The MetadataBase enforces a strict snapshot_time. This timestamp represents the "End of History" for the model. Any data point generated after this time is considered "Future Leakage" and is programmatically inaccessible during backtesting.

Project Structure

src/xrtm/data/
├── core/            # Interfaces & Schemas (domain-agnostic)
│   ├── interfaces.py    # DataSource protocol
│   └── schemas/         # ForecastQuestion, ForecastOutput, etc.
├── kit/             # Composable utilities (processors)
└── providers/       # External data source implementations
    ├── local/           # LocalDataSource (JSON files)
    └── online/          # PolymarketSource (Gamma API)

Development

Prerequisites:

# Install dependencies
uv sync

# Run tests
uv run pytest

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

xrtm_data-0.2.4.tar.gz (39.6 kB view details)

Uploaded Source

Built Distribution

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

xrtm_data-0.2.4-py3-none-any.whl (44.0 kB view details)

Uploaded Python 3

File details

Details for the file xrtm_data-0.2.4.tar.gz.

File metadata

  • Download URL: xrtm_data-0.2.4.tar.gz
  • Upload date:
  • Size: 39.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for xrtm_data-0.2.4.tar.gz
Algorithm Hash digest
SHA256 989b74de3d8d0107159544b12cf1e823aa669c3e0143be5c0cbad2a11a24e7ac
MD5 a57fe7b5296be14349ed418704af26ee
BLAKE2b-256 b01cb66b7c462495936627d920f398a93247d36d8d0d19afe2376e408fb8e410

See more details on using hashes here.

Provenance

The following attestation bundles were made for xrtm_data-0.2.4.tar.gz:

Publisher: publish.yml on xrtm-org/data

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

File details

Details for the file xrtm_data-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: xrtm_data-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 44.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for xrtm_data-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 db03622dff1b11dac36fe0fd25407935a7c2ce096e68c4394b5f1a6f71a8f3aa
MD5 5a02487297682a57b375615c5bf967f4
BLAKE2b-256 f77406fd81e97eea2a6167a4fd88a371c39e5d1144ec316176abf848c4758738

See more details on using hashes here.

Provenance

The following attestation bundles were made for xrtm_data-0.2.4-py3-none-any.whl:

Publisher: publish.yml on xrtm-org/data

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

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