Skip to main content

metricflow logo

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metricflow-0.213.0.tar.gz (643.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metricflow-0.213.0-py3-none-any.whl (999.5 kB view details)

Uploaded Python 3

File details

Details for the file metricflow-0.213.0.tar.gz.

File metadata

  • Download URL: metricflow-0.213.0.tar.gz
  • Upload date:
  • Size: 643.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for metricflow-0.213.0.tar.gz
Algorithm Hash digest
SHA256 e6b5e8f05a0b9b0183430416052a61747fc89f809c39f2cdc5a3d9ba7a3f6931
MD5 982569511c05f5b73ed8148873ffadb7
BLAKE2b-256 a6ae0c75d87f004cd56f30862fa1330f6a4e36a26ea32463a6d17d5d1ab32413

See more details on using hashes here.

Provenance

The following attestation bundles were made for metricflow-0.213.0.tar.gz:

Publisher: cd-push-metricflow-to-pypi.yaml on dbt-labs/metricflow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metricflow-0.213.0-py3-none-any.whl.

File metadata

  • Download URL: metricflow-0.213.0-py3-none-any.whl
  • Upload date:
  • Size: 999.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for metricflow-0.213.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e1865535a200607529970f6ca1a9fcd22b7814d0b71cd654d9ee01eecf0157b
MD5 d735c66e72a671b9f0a4ed2518110cbc
BLAKE2b-256 586c2ec7e3c433bdab3cf15f4424769794f6d0dab9ecd3c43da00cdb85435d44

See more details on using hashes here.

Provenance

The following attestation bundles were made for metricflow-0.213.0-py3-none-any.whl:

Publisher: cd-push-metricflow-to-pypi.yaml on dbt-labs/metricflow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.213.0 This release

2 files

0.212.0

2 files

0.211.0

2 files

0.210.0

2 files

0.209.0

2 files

0.208.1

2 files

0.208.0

2 files

0.207.3

2 files

0.207.2

2 files

0.207.1

2 files

0.207.0

2 files

0.206.0

2 files

0.205.0

2 files

0.204.0

2 files

0.203.1

2 files

0.203.0

2 files

0.202.0

2 files

0.201.0

2 files

0.200.0

2 files

0.140.0

2 files

0.130.1

2 files

0.130.0

2 files

0.120.0

2 files

0.111.1

2 files

0.111.0

2 files

0.110.1

2 files

0.110.0

1 file

0.100.2

2 files

0.100.1

2 files

0.100.0

2 files

0.93.0

2 files

0.92.1

2 files

0.92

2 files

0.91.9

2 files

0.91.8

2 files

0.91.7

2 files

0.91.6

2 files

0.91.5

2 files

0.91.4

2 files

0.91.3

2 files

0.91.2

2 files

0.91.1

2 files

0.91

2 files

0.9.999

2 files

0.9.99

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page