Skip to main content

Translates a simple metric definition into reusable SQL and executes it against the SQL engine of your choice.

Project description

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.

Project details


Download files

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

Source Distribution

metricflow_klook_data-0.209.0.dev1.tar.gz (715.2 kB view details)

Uploaded Source

Built Distribution

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

metricflow_klook_data-0.209.0.dev1-py3-none-any.whl (983.0 kB view details)

Uploaded Python 3

File details

Details for the file metricflow_klook_data-0.209.0.dev1.tar.gz.

File metadata

File hashes

Hashes for metricflow_klook_data-0.209.0.dev1.tar.gz
Algorithm Hash digest
SHA256 1ff707bc5b8e850cd96a0c67c1c4be0f8b1a854562d4f2d778e0cf7dd2b98177
MD5 5325d753f219a6a0645634da0b351a0c
BLAKE2b-256 9021bcb52edc15dfd0e13aabc2fdb2f67470299158d89b8329c844133f9f6ea5

See more details on using hashes here.

File details

Details for the file metricflow_klook_data-0.209.0.dev1-py3-none-any.whl.

File metadata

File hashes

Hashes for metricflow_klook_data-0.209.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 e974d53461f0729896f2f50d41e0d900bc77c14c25c75d956ce2ceba2edecff4
MD5 f94f12d277eb7e9a64bfde1b26c8489a
BLAKE2b-256 5c9dd44464f2e0ece954d945493881ab39f1887ec3732b426f413104a2c47520

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page