Skip to content

Find an API by task

Start with the task below, then follow the linked signature and its input contract. The module index groups concepts; the Python reference lists importable namespaces, and rustdoc lists Rust paths. A module guide’s title is not necessarily its Python import name. If a call rejects your inputs or returns an unsuitable result, use Diagnose input errors.

TaskPython entry pointWhat to check before using it
Preserve selected source values through cleaningprovenance.select_revisions, rejoin_selectedSelect before cleaning and rejoin by stable IDs. Exact typed identity does not prove provider authenticity or history completeness.
Assemble complete declared feature rowsfeature_assembly.assemble_featuresSpecify feature order and required source fields. Retain missing-input exclusions and remap original row indices after filtering.
Audit training-time availabilityavailability.select_available_trainingSupply explicit source and label clocks and the splitter’s original training indices; this filter does not replace purging or fold-local preprocessing.
Build meta-labels from a primary model’s sideslabeling.get_events, labeling.get_binsPreserve primary-side provenance. These functions consume supplied sides; they do not fit either model or enforce out-of-sample prediction boundaries.
Load and inspect local OHLCV datadata.load_ohlcv, data.data_quality_reportFirst resolve point-in-time revision availability; loading and cleaning do not enforce it. The Python interface takes frames/files; the native _core.data exposes separate column and frame calls. Rust uses data_processing.
Explain why rows left a validation foldcross_validation.split_with_diagnosticsSupply ordered label spans in consistent units. Diagnostics describe purge/embargo exclusions, not whether feature construction leaked.
Bootstrap labels inside a training foldsampling.seq_bootstrap; worked handoffDraws index training-local label columns. Map through training indices to original rows, preserve multiplicity across fitting arrays, and keep test rows excluded. Repeated draws are not independent new observations.
Score predictions already produced out of samplefeature_importance.mda_from_probabilities, sfi_from_probabilitiesThese consume predictions you supply; they do not fit your model. Preserve original rows and feature columns; see saved-prediction handoffs.
Fit the built-in diagnostic models on featuresfeature_diagnostics.mda_importance, sfi_importanceThese are different interfaces from the prediction consumers above. Read the diagnostic model and preprocessing assumptions.
Track the trial count used for selection-adjusted reportingevaluation.TrialRegistryCounts unique explicit configuration keys; repeating a key replaces its entry. Include all attempted choices in those keys; see the trial-identity contract.
Allocate using supplied returns or covarianceportfolio.allocate_from_inputsFollow observations to named weights for timestamp/asset alignment, then check covariance validity, bounds and units in portfolio optimization.
Assemble predictions into CPCV pathsbacktesting_engine.assemble_cpcv_pathsRestore split and sample order before assembly. Paths reuse observations and are dependent; their spread is descriptive.
Convert an API result into a frame for analysisadaptersChoose the adapter for the result type. Conversion does not establish timestamp alignment, calibration, or account-level P&L.

For an integrated example, use the Python workflow or Rust workflow. Both are API demonstrations; training and held-out evaluation remain separate work. For a fitted baseline and held-out predictions, follow the end-to-end research journey. For parameter selection before one final chronological assessment, use the model-selection walkthrough. It connects purged inner splits, training-only preprocessing and explicit refitting; its final classification score is separate from the search score and is not trading P&L.

Use openquant.<namespace> as the starting point. Seven namespaces have a Python wrapper and a separately documented native surface: backtesting_engine, bars, cross_validation, data, feature_importance, hyperparameter_tuning, and pipeline. Their low-level references are named openquant._core.<namespace>. A shared function name does not imply identical accepted inputs or return types.

For example, the validation wrapper returns NumPy index arrays while its native counterpart returns lists. This small example also checks that fold row positions agree; the integers here are abstract, consistently ordered time units.

import numpy as np
from openquant import cross_validation
from openquant._core import cross_validation as native_cv
t0 = [0, 2, 4, 6, 8, 10]
t1 = [1, 3, 5, 7, 9, 11]
wrapped = cross_validation.purged_kfold_splits(t0, t1, 3, 0.0)
native = native_cv.purged_kfold_splits(t0, t1, 3, 0.0)
assert isinstance(wrapped[0][0], np.ndarray)
assert isinstance(native[0][0], list)
assert [(train.tolist(), test.tolist()) for train, test in wrapped] == native
print(wrapped[0][0].tolist(), wrapped[0][1].tolist())
[2, 3, 4, 5] [0, 1]

Other native namespaces such as risk, hrp, and fracdiff are re-exported directly at the package root. Pure-Python namespaces such as evaluation, feature_diagnostics, and viz have no same-name _core module.

These common aliases help when moving from a Python example to rustdoc. They identify related modules, not interchangeable function signatures.

Python namespaceRust module
barsdata_structures
datadata_processing for OHLCV operations; Python caching/fetching is a separate layer
riskrisk_metrics
portfolioportfolio_optimization
backtest_statsbacktest_statistics
synthetic_btsynthetic_backtesting
microstructuralmicrostructural_features
ensembleensemble_methods
fast_ewma, volatilityutil::fast_ewma, util::volatility

These public Rust APIs have no Python binding. Similar names elsewhere do not supply the same operation.

TaskRust entry point and worked guide
Build a rebalanced futures basket or roll seriesetf_trick::EtfTrick, get_futures_roll_series; guide
Decompose a fitted predictor’s feature effectsfingerprint::RegressionModelFingerprint; guide. Python feature importance measures are different diagnostics.
Dispatch a user-supplied computation over partitionshpc_parallel::run_parallel; guide. Python streaming_hpc supplies specific streaming calculations, not this generic executor.
Supply a custom integer objective or solver adaptercombinatorial_optimization::IntegerObjective, SolverAdapter; guide. Python dynamic_allocation exposes a particular allocation problem, not these traits.