Expand description
Parser module for Forge YAML models
This module provides functionality for parsing Forge YAML files into
structured ParsedModel objects that can be calculated and analyzed.
§Submodules
arrays: Array/column type parsing (Number, Text, Date, Boolean)schema: JSON Schema validation (v1.0.0 and v5.0.0)multi_doc: Multi-document YAML parsing (v4.4.2)includes: Cross-file include resolution (v4.0)variables: Table and scalar variable parsingmodel: Core model parsing logic
Functions§
- detect_
array_ type - Detect the type of a YAML value
- detect_
multi_ document - Detect if content is a multi-document YAML file A multi-document file has at least two document separators (—) on their own lines
- is_
nested_ scalar_ section - Check if a mapping contains nested scalar sections (e.g., summary.total) Returns false for v4.0 rich table columns (where value is an array)
- is_
valid_ date_ format - Check if a string is a valid date format (YYYY-MM or YYYY-MM-DD)
- parse_
array_ value - Parse a YAML array into a typed
ColumnValue - parse_
includes - Parse _includes section from YAML (v4.0 cross-file references)
- parse_
metadata - Extract metadata fields from a YAML mapping (v4.0)
- parse_
model - Parse a Forge model file (v1.0.0 array format) and return a
ParsedModel. - parse_
multi_ document_ yaml - Parse a multi-document YAML file (v4.4.2) Each document is parsed and merged into a single model. Document names come from _name field or are auto-generated as “doc1”, “doc2”, etc.
- parse_
nested_ scalars - Parse nested scalar variables (e.g., summary.total, summary.average)
- parse_
scalar_ variable - Parse a scalar variable (v4.0 enhanced with metadata)
- parse_
scenarios - Parse scenarios section from YAML
- parse_
single_ document_ yaml - Parse a single YAML document
- parse_
table - Parse a table from a YAML mapping (v4.0 enhanced with metadata)
- parse_
v1_ model - Parse v1.0.0 array model
- resolve_
includes - Resolve all includes in a model, loading and parsing referenced files. Detects circular dependencies.
- split_
yaml_ documents - Split YAML content into separate documents by “—” separator lines
- type_
name - Get the type name of a YAML value for error messages
- validate_
against_ schema - Validate YAML against the appropriate Forge JSON Schema based on _
forge_version - validate_
v1_ 0_ 0_ no_ tables - Runtime validation: v1.0.0 models must NOT contain tables (arrays) This provides a clear error message when users try to use v5.0.0 features in a v1.0.0 model