Skip to main content

mollendorff_forge/
lib.rs

1//! Forge - YAML formula calculator with Excel-style arrays
2//!
3//! This library provides functionality to parse YAML files containing formulas,
4//! calculate them in dependency order, and update values.
5//!
6//! # Features
7//!
8//! - Excel-style formulas in YAML files (SUM, AVERAGE, IF, etc.)
9//! - Array model for Excel-compatible column-based data
10//! - JSON Schema validation
11//! - Type-safe homogeneous arrays (Number, Text, Date, Boolean)
12//! - Excel import/export
13//! - Multi-document YAML support
14//!
15//! # Example
16//!
17//! ```no_run
18//! use mollendorff_forge::parser::parse_model;
19//! use mollendorff_forge::core::ArrayCalculator;
20//! use std::path::Path;
21//!
22//! let path = Path::new("model.yaml");
23//! let model = parse_model(path)?;
24//!
25//! println!("Tables: {}", model.tables.len());
26//! println!("Scalars: {}", model.scalars.len());
27//!
28//! let calculator = ArrayCalculator::new(model);
29//! let result = calculator.calculate_all()?;
30//! # Ok::<(), mollendorff_forge::error::ForgeError>(())
31//! ```
32
33// Demo modules (always included)
34pub mod cli;
35pub mod core;
36pub mod error;
37pub mod excel;
38pub mod functions;
39pub mod parser;
40pub mod types;
41pub mod writer;
42
43// Analysis modules
44pub mod api;
45pub mod bayesian;
46pub mod bootstrap;
47pub mod decision_trees;
48pub mod mcp;
49pub mod monte_carlo;
50pub mod real_options;
51pub mod scenarios;
52pub mod tornado;
53
54// Re-export commonly used types
55pub use error::{ForgeError, ForgeResult};
56pub use types::{Column, ColumnValue, ParsedModel, Table, Variable};