Title: Hi HN community, I’m Nick, co-founder&#x2F;CEO of Transform.co. I’m thrilled to share MetricFlow, an open-source metric creation framework: <a href="https:&#x2F;&#x2F;github.com&#x2F;transform-data&#x2F;metricflow" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;transform-data&#x2F;metricflow</a><p>MetricFlow strives to make what has historically been an extremely repetitive process, writing SQL queries on core normalized data models, much more DRY. MetricFlow consolidates the definitions for joins, aggregations, filters, etc., and programmatically generates SQL to construct data marts. You can think of it like LookML, but more powerful and ergonomic (and open source!). The project has three components:<p>1. MetricFlow Spec: The specification encapsulates metric logic in a more reusable set of abstractions: data_sources, measures, dimensions, identifiers, metrics, and materializations.<p>2. DataFlow Planner: The Query Planner is a generalized SQL constructor. We take in data sources (ideally normalized data models) and generate a graph of data transformations (a flow, if you will) – joins, aggregations, filters, etc. We take that graph and render it down to db-specific SQL while optimizing it for performance and legibility.<p>3. MetricFlow Interfaces: The CLI and Python SDK rely on the flexibility of the Spec and Planner to build just about any query you could ask for on top of your data warehouse.<p>These components enable novel features that other semantic layers struggle to support today:<p>- MetricFlow enables the user to traverse the entire graph of a company’s data warehouse without confining their analysis to pre-built data models (dbt), Explores (in Looker), or Cubes (in lots of tools).<p>- The Metric abstraction allows the construction of complex metrics that traverse the graph described above to rely on multiple data sources. We support several common metric types today, and adding more is a critical part of the open-source roadmap.<p>- The Materialization abstraction allows users to define and then programmatically generate data marts that rely on a single DRY expression of the metrics and dimensions.<p>MetricFlow is open source(<a href="https:&#x2F;&#x2F;github.com&#x2F;transform-data&#x2F;metricflow" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;transform-data&#x2F;metricflow</a>) and distributed through pypi (`pip install metricflow`). You can set up (`mf setup`) a set of sample configs and try out a tutorial (`mf tutorial). The docs are all here(<a href="https:&#x2F;&#x2F;docs.transform.co&#x2F;docs&#x2F;overview&#x2F;metricflow-overview" rel="nofollow">https:&#x2F;&#x2F;docs.transform.co&#x2F;docs&#x2F;overview&#x2F;metricflow-overview</a>). We’d love contributions on GitHub. We’re adding new Issues to share our roadmap in the coming days, but feel free to open your own.<p>We’re also opening up a Slack community(<a href="https:&#x2F;&#x2F;community.transform.co&#x2F;metricflow-signup" rel="nofollow">https:&#x2F;&#x2F;community.transform.co&#x2F;metricflow-signup</a>) to talk about the project and, more generally, metric tooling.<p>Let us know what you think – we’ll be here answering any questions!
Upvote: