How mountainash-io/mountainash works
mountainash is a backend-independent semantic layer for tabular data: users build expressions and relational plans, then compile or materialize them on Polars, Narwhals, or Ibis. The main path runs from Python or frame input through relation and expression ASTs, backend selection and visitors, then to a native plan or requested output. The README also describes TypeSpec extraction and conformance and relation DAGs. Evidence is limited to the README, source index references, and excerpts shown; some documented subsystems are represented at directory level.
Main entry points: relation.py Relation API · visitor.py Expression visitor · relation_visitor.py Relation visitor · entrypoints.py Expression API
Components 19
Semantic API
- Expression API
src/mountainash/expressions/core/expression_api/entrypoints.py - Expression AST
src/mountainash/expressions/core/expression_nodes/substrait/exn_base.py
Plans and schemas
- Relation API
src/mountainash/relations/core/relation_api/relation.py - Relation nodes
src/mountainash/relations/core/relation_nodes/reln_base.py - TypeSpec schemas
src/mountainash/typespec/frictionless.py - Schema extraction
src/mountainash/typespec/extraction.py - Schema conformance
src/mountainash/conform/compiler.py - Relation DAG
src/mountainash/relations/dag/dag.py
Compilation
- Function registry
src/mountainash/expressions/core/expression_system/function_mapping/registry.py - Expression visitor
src/mountainash/expressions/core/unified_visitor/visitor.py - Relation visitor
src/mountainash/relations/core/unified_visitor/relation_visitor.py - Relation backends
src/mountainash/relations/backends/relation_systems/polars/__init__.py - Expression backends
src/mountainash/expressions/backends/expression_systems/base.py
Data boundaries
- Python ingress
src/mountainash/pydata/ingress/pydata_ingress.py - Data readers
src/mountainash/relations/dag/readers/csv.py - Output conversion
src/mountainash/pydata/egress/egress_to_pythondata.py
Other components
- Application
- Native result
- Remote storage
Connections 21
- Application → Expression API: builds expressions
README.md - Application → Relation API: builds plans
README.md - Relation API → Relation nodes: creates nodes
src/mountainash/relations/core/relation_api/relation.py - Expression API → Expression AST: creates nodes
src/mountainash/expressions/core/expression_api/entrypoints.py - Relation API → Python ingress: converts input
src/mountainash/relations/core/relation_api/relation.py - Application → Schema extraction: extracts schema
README.md - Schema extraction → TypeSpec schemas: produces schema
src/mountainash/typespec/extraction.py - Relation API → Schema conformance: adds conformance
README.md - Schema conformance → TypeSpec schemas: uses schema
- Relation API → Relation DAG: integrates DAG
src/mountainash/relations/dag/dag.py - Relation nodes → Relation visitor: walked by
src/mountainash/relations/core/unified_visitor/relation_visitor.py - Expression AST → Expression visitor: walked by
- Expression visitor → Function registry: resolves functions
src/mountainash/expressions/core/unified_visitor/visitor.py - Relation visitor → Expression visitor: compiles expressions
src/mountainash/relations/core/unified_visitor/relation_visitor.py - Relation visitor → Relation backends: dispatches operations
src/mountainash/relations/core/unified_visitor/relation_visitor.py - Expression visitor → Expression backends: lowers expressions
README.md - Relation backends → Native result: returns native plan
README.md - Application → Data readers: loads resources
- Data readers → Remote storage: reads remote bytes
- Application → Output conversion: requests output
README.md - Output conversion → Native result: converts result