Translates a simple metric definition into reusable SQL and executes it against the SQL engine of your choice.
Project description
Build and maintain all of your metric logic in code.
Welcome to MetricFlow
See our latest updates in the Metricflow Changelog!
MetricFlow is a semantic layer that simplifies defining and managing metrics. It compiles these metric definitions into clear, reusable SQL, ensuring consistent and accurate results when analyzing data by relevant attributes (dimensions).
The name “MetricFlow” reflects its approach: metric requests are compiled into a dataflow-based query plan, which is then optimized and translated into engine-specific SQL.
MetricFlow provides a set of abstractions that help you construct complicated logic and dynamically generate queries to handle:
- Multi-hop joins between fact and dimension sources
- Complex metric types such as ratio, expression, and cumulative
- Metric aggregation to different time granularities
- And so much more
To get up and running with your own metrics, you should rely on MetricFlow’s documentation.
Licensing
MetricFlow is distributed under the Apache 2.0 license. For details, please refer to our licensing agreement.
Open Semantic Interchange (OSI) Initiative
MetricFlow is developed and maintained as part of the Open Semantic Interchange (OSI) initiative. The OSI initiative is a collaborative effort among leading technology companies and data practitioners to establish a open standard for defining and exchanging semantic information, enabling AI/BI interoperability across different platforms and tools.
Getting Started
Install MetricFlow
MetricFlow can be installed from PyPi for use as a Python library with the following command:
pip install dbt-metricflow
MetricFlow currently serves as a query compilation and SQL rendering library, built to work in conjunction with a dbt project. As such, using MetricFlow requires a working dbt project and a dbt adapter. We provide the dbt-metricflow bundle for this purpose. You may choose to install other adapters as optional extras from dbt-metricflow.
You may need to install Postgres or Graphviz. You can do so by following the install instructions for Postgres or Graphviz. Mac users may prefer to use brew: brew install postgresql or brew install graphviz.
Tutorial
The best way to get started is to follow the tutorial steps, which you can access by running:
mf tutorial
Note: this must be run from a dbt project root directory.
Resources
Contributing and Code of Conduct
This project will be a place where people can easily contribute high-quality updates in a supportive environment.
Please read our code of conduct before diving in.
To get started on direct contributions, head on over to our contributor guide.
License History
MetricFlow is source-available software.
Version 0 to 0.140.0 was covered by the Affero GPL license. Version 0.150.0 to 0.208.2 was covered by the BSL license. Version 0.209.0 and greater is covered by the Apache 2.0 license.
MetricFlow is built by dbt Labs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metricflow-0.209.0.tar.gz.
File metadata
- Download URL: metricflow-0.209.0.tar.gz
- Upload date:
- Size: 709.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58187952eb2e96f0c33b4ceea2701572555fabf435eea44ca24fcba7fb4c53f9
|
|
| MD5 |
32a22b4aeb06c946d0d7a9117e0ab173
|
|
| BLAKE2b-256 |
4bd3cf47af37c2109738fe69abb803b5301726b4e923ecd1758834e28147a4e9
|
Provenance
The following attestation bundles were made for metricflow-0.209.0.tar.gz:
Publisher:
cd-push-metricflow-to-pypi.yaml on dbt-labs/metricflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metricflow-0.209.0.tar.gz -
Subject digest:
58187952eb2e96f0c33b4ceea2701572555fabf435eea44ca24fcba7fb4c53f9 - Sigstore transparency entry: 605585300
- Sigstore integration time:
-
Permalink:
dbt-labs/metricflow@ce79457928444139a20907b65cc6282f5cb0aa72 -
Branch / Tag:
refs/tags/v0.209.0 - Owner: https://github.com/dbt-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd-push-metricflow-to-pypi.yaml@ce79457928444139a20907b65cc6282f5cb0aa72 -
Trigger Event:
push
-
Statement type:
File details
Details for the file metricflow-0.209.0-py3-none-any.whl.
File metadata
- Download URL: metricflow-0.209.0-py3-none-any.whl
- Upload date:
- Size: 979.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bebde4638b054157c06fc10700e85ff7a7bf775e3cde24922c7b437a445204b
|
|
| MD5 |
c0b42315ed7a9d2f7fb86cfab161376d
|
|
| BLAKE2b-256 |
a84c58eb89edb3f4535b98de0366d15efc74069feae7ec32271a3939ab9348af
|
Provenance
The following attestation bundles were made for metricflow-0.209.0-py3-none-any.whl:
Publisher:
cd-push-metricflow-to-pypi.yaml on dbt-labs/metricflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metricflow-0.209.0-py3-none-any.whl -
Subject digest:
1bebde4638b054157c06fc10700e85ff7a7bf775e3cde24922c7b437a445204b - Sigstore transparency entry: 605585313
- Sigstore integration time:
-
Permalink:
dbt-labs/metricflow@ce79457928444139a20907b65cc6282f5cb0aa72 -
Branch / Tag:
refs/tags/v0.209.0 - Owner: https://github.com/dbt-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd-push-metricflow-to-pypi.yaml@ce79457928444139a20907b65cc6282f5cb0aa72 -
Trigger Event:
push
-
Statement type: