🤖 AI Summary
This paper addresses the lack of a unified, semantically clear syntactic framework for data analysis. It proposes a novel, operation-agnostic analytical syntax grounded in two primitive constructs—“measures” and “dimensions”—thereby abstracting analytical logic and decoupling semantic intent from underlying data sources. This design significantly enhances readability, reusability, and maintainability of analytical expressions. To our knowledge, this is the first systematic formulation of such a syntax model. Based on it, we design and open-source Meterstick, a Python library supporting unified analysis across heterogeneous backends—including pandas DataFrames and SQL databases. Empirical evaluation demonstrates that the framework delivers efficient execution while enabling cross-platform, declarative, and composable analytical modeling. By providing a foundational syntax layer, it advances the Analytics-as-Code paradigm.
📝 Abstract
This paper outlines a grammar of data analysis, as distinct from grammars of data manipulation, in which the primitives are metrics and dimensions. We describe a Python implementation of this grammar called Meterstick, which is agnostic to the underlying data source, which may be a DataFrame or a SQL database.