Expand description
§volas
A Rust-backed, OHLCV-shaped DataFrame for candlestick / market time-series,
with a technical-indicator directive engine.
volas is intentionally narrow: it is not a general-purpose DataFrame. It targets
live OHLCV pipelines — append a new bar, keep indicator columns cached, and
recompute only the stale tail (O(lookback + new rows), not O(n)).
This is the umbrella crate. It re-exports the everyday types at the top level and groups the rest under modules:
- top level — the data model (
DataFrame,Series,Column,Index,DType,Scalar,Tz,Result,VolasError) plus CSVread_csvandTimeFrame; directive— parse a directive string into anAst, thenexecuteit;compute— numeric kernels and technical indicators (pure functions);time— time-frame cumulation (OHLCV resampling);core— the fullvolas-coresurface, for the less-common types.
use volas::{Column, DataFrame};
use volas::directive::{execute, parse};
let df = DataFrame::new(
vec!["close".to_string()],
vec![Column::f64(vec![1.0, 2.0, 3.0, 4.0])],
None,
)?;
// `ma:2` is a 2-period simple moving average over `close`.
let directive = parse("ma:2")?;
let ma = execute(&df, &directive)?;
assert_eq!(ma.len(), 4);
assert_eq!(ma.to_f64_vec()[3], 3.5); // (3.0 + 4.0) / 2Re-exports§
pub use volas_core as core;
Modules§
- compute
- Numeric kernels and technical indicators — pure functions over slices, usable
without a
DataFrame. - directive
- The directive engine: parse a directive string (e.g.
"ma:20","macd.signal","close > open") into anAst, then [execute] it against aDataFrameto get aColumn. - time
- Time-frame cumulation (OHLCV resampling): aggregate finer bars into a coarser
TimeFrame.
Structs§
- Data
Frame - A 2-D, column-oriented, time-indexed table. All columns share one index and
have equal length (
height). - Index
- Row labels plus an optional name.
- Read
CsvOptions - Options controlling
read_csv. - Series
- A one-dimensional, named, indexed column.
Enums§
- Column
- A typed, contiguous column of values. The buffer is
Arc-shared (cheap clone) and mutated copy-on-write. - DType
- The logical data type of a
crate::Column. - Index
Kind - The label storage backing an
Index. - Label
- A single row-index label: an integer / datetime (
I64, ns) or a string (Str). It decouples label lookup from the index’s storage so the same.loc/.at/.loc[a:b]/droppaths serve every index kind. - Scalar
- The result of a dtype-preserving scalar reduction (
Column::sumetc.), carrying the value in its pandas result dtype so the binding can box it as the matching numpy scalar (np.int64/np.float64/np.bool_). - Time
Frame - An OHLCV sampling period.
- Tz
- The timezone attached to a
DatetimeIndex. Storage is always UTC epoch-ns; this drives wall-clock conversion only. - Volas
Error - Errors raised by the volas core. The Python binding maps each variant to a
typed exception (see
volas-python).
Functions§
- read_
csv - Read a CSV file into a
DataFrame, inferring each column’s dtype (i64->f64->bool->str).
Type Aliases§
- Result
- Convenience result alias used throughout the core.