Skip to content

Mountainash TreeSpec

An intelligent textbook for mountainash-treespec -- bidirectional hierarchical data transformation.

Transitional publishing: This manual remains on the central site until its per-repository cutover.

Open textbook

Chapters

  1. Foundation Concepts
  2. Spec Model
  3. Flatten Engine
  4. Type System
  5. Schema Handling
  6. Build Engine
  7. Format Handlers
  8. Batch Processing
  9. Hooks System

Key Topics

  • Spec model -- TreeSpec, NodeSpec, ChildSpec, and MetaConfig for declaratively specifying tree-to-table decomposition rules
  • Flatten and build engines -- TreeFlattener walks dataclass trees into flat relational tables; TreeBuilder reconstructs trees from flat tables using FK pre-indexing
  • Format handlers -- pluggable schema handlers for JSON/Dataclass, XML/xsdata, Protobuf, Pydantic, and Avro with registry-based dispatch
  • Batch processing -- BatchFlattener and BatchBuilder for multi-file operations with source columns, concat, dedup, and cascade dedup
  • Hooks system -- HookRegistry with condition, field_transform, pre_flatten, and post_build decorator-based hooks for custom transformation logic