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 makes it easy to organize metric definitions. It takes those definitions and generates legible and reusable SQL. This makes it easy to get consistent metrics output broken down by attributes (dimensions) of interest.

The name comes from the approach taken to generate metrics. A query is compiled into a query plan (represented below) called a dataflow that constructs metrics. The plan is then optimized and rendered to 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

As a developer, you can also use MetricFlow's interfaces to construct APIs for integrations to bring metrics into downstream tools in your data stack.

To get up and running with your own metrics, you should rely on MetricFlow’s documentation available at MetricFlow docs.

Getting Started

Install MetricFlow

MetricFlow can be installed from PyPi for use as a Python library with the following command:

pip install metricflow

Once installed, MetricFlow can be setup and connected to a data warehouse by following the instructions after issuing the command:

mf setup

In case you don't have a connection to a data warehouse available and want a self-contained demo, DuckDB can be selected.

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:

mf tutorial

There are several examples of MetricFlow configs on common data sets in the config-templates folder. The tutorial will rely on a small set of sample configs.

Resources

Contributing and Code of Conduct

This project will be a place where people can easily contribute high-quality updates in a supportive environment.

You might wish to read our code of conduct and engineering practices before diving in.

To get started on direct contributions, head on over to our contributor guide.

License

MetricFlow is open source software. The project relies on several licenses including AGPL-3.0-or-later and Apache (specified at folder level).

MetricFlow is built by Transform.

Download files

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

Source Distribution

datus_metricflow-0.2.8.tar.gz (870.4 kB view details)

Uploaded Source

Built Distribution

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

datus_metricflow-0.2.8-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

Details for the file datus_metricflow-0.2.8.tar.gz.

File metadata

  • Download URL: datus_metricflow-0.2.8.tar.gz
  • Upload date:
  • Size: 870.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for datus_metricflow-0.2.8.tar.gz
Algorithm Hash digest
SHA256 3dbbfe49a2110c8aa04a27ce7b2a93e88127f1e6e04664f8dfa2420244e72867
MD5 28adb3520bfa84d564c418bb5c1e3711
BLAKE2b-256 739fd62804c613565381fb6134d0bb1983bf5a112b79f2def20220955f9853ce

See more details on using hashes here.

File details

Details for the file datus_metricflow-0.2.8-py3-none-any.whl.

File metadata

File hashes

Hashes for datus_metricflow-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 6e14627e4e41bd0a7076cbcdb5327f654bd2c146483d594ea545e42e7e319dcb
MD5 3c4f215e33ad9e14dbe8b7b78731c8e1
BLAKE2b-256 9215cd1ef778879b744ee0dc93edb0d186a72270b1188a47505185de2e9f7c97

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.8 This release

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

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