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.

Metadata

Release files for datus-metricflow 0.2.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datus-metricflow 0.2.8
File Size Uploaded Provenance Actions
datus_metricflow-0.2.8.tar.gz 870.4 kB Without provenance Details for datus_metricflow-0.2.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for datus-metricflow 0.2.8
File Interpreter ABI Platform Actions
datus_metricflow-0.2.8-py3-none-any.whl Python 3 none any Details for datus_metricflow-0.2.8-py3-none-any.whl

Total release size: 2.7 MB

Release files / datus_metricflow-0.2.8.tar.gz

Download URL datus_metricflow-0.2.8.tar.gz
Size 870.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3dbbfe49a2110c8aa04a27ce7b2a93e88127f1e6e04664f8dfa2420244e72867
BLAKE2b-256 checksum
How to use checksums
739fd62804c613565381fb6134d0bb1983bf5a112b79f2def20220955f9853ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / datus_metricflow-0.2.8-py3-none-any.whl

Download URL datus_metricflow-0.2.8-py3-none-any.whl
Size 1.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
6e14627e4e41bd0a7076cbcdb5327f654bd2c146483d594ea545e42e7e319dcb
BLAKE2b-256 checksum
How to use checksums
9215cd1ef778879b744ee0dc93edb0d186a72270b1188a47505185de2e9f7c97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for datus-metricflow 0.2.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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