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, the canonical runtime schema is ForecastResult (legacy alias: ForecastOutput). Every forecast result carries forecast_request_id, probability, a reasoning_trace, and an optional execution_trace. Legacy question_id, reasoning, logical_trace, logical_edges, and structural_trace inputs remain accepted for compatibility.

from xrtm.data import ForecastResult, CausalNode

forecast_result = ForecastResult(
    forecast_request_id="q_123",
    probability=0.75,
    reasoning_trace={
        "narrative": "Base rate analysis suggests...",
        "causal_graph": {
            "nodes": [
                CausalNode(event="Inflation rises", probability=0.8),
                CausalNode(event="Fed cuts rates", probability=0.4),
            ]
        },
    },
    execution_trace=["ingestion", "forecast"],
)

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/         # ForecastRequest, ForecastResult, 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.7.tar.gz (63.4 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.7-py3-none-any.whl (66.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xrtm_data-0.2.7.tar.gz
  • Upload date:
  • Size: 63.4 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.7.tar.gz
Algorithm Hash digest
SHA256 79101b858998ca92fb0ab07291f3245b8927a01608066748550a01dec4dfa46a
MD5 60ab743d230c51fc68bb56341d288cde
BLAKE2b-256 abe487560d2616d1dc32a2f371e891e21c63e9ef57720ea84ea6fe645bf2598b

See more details on using hashes here.

Provenance

The following attestation bundles were made for xrtm_data-0.2.7.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.7-py3-none-any.whl.

File metadata

  • Download URL: xrtm_data-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 66.5 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7b3d269b9f3201ece92c93a5dd356711a4e1cfc0d3429238ef6b2f3a4b772502
MD5 2655df83068d9d218314dcfb396b7d05
BLAKE2b-256 30edab49d58d6c5ed16a368841a93977a6d140afe2f45e200786fe1b68a4d4b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for xrtm_data-0.2.7-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