metricflow
Translates a simple metric definition into reusable SQL and executes it against the SQL engine of your choice.
Decision gist · record as of 2026-08-14
Yes, if you need to centralize metric logic in code. MetricFlow is actively maintained, has no known vulnerabilities, carries a permissive Apache-2.0 license, and installs with low friction. It solves a real problem—metric consistency and reusability—but requires a dbt project and adapter to work, so it is not a standalone tool. Best suited for teams already invested in dbt.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a working dbt project, a dbt adapter, and optionally Postgres or Graphviz installed on the system.
- Low install friction with a pure Python wheel.
- Active maintenance with a release 2 days ago.
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 permissive license. Version 0.212.0 is covered by Apache-2.0 (versions 0.209.0 and greater); earlier versions were under AGPL or BSL, so this version carries no copyleft obligations.
last release 2026-08-12 (2 days) · last repo commit 2026-08-13 · 1,740 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 4,310,188 downloads/mo, #2,335 on PyPI
Alternatives
Verify before relying
pip install metricflow
import metricflow
# Requires a working dbt project and dbt adapter configured before use- Whether the package can be used standalone or strictly requires dbt project integration for all operations.
- Performance characteristics and scalability limits for large metric definitions or complex joins.
- Whether Postgres and Graphviz are required or only needed for specific features.
What it is and what it does
MetricFlow is a semantic layer that translates metric definitions into SQL queries optimized for your data warehouse. It abstracts away the complexity of multi-hop joins between fact and dimension tables, handles advanced metric types (ratio, expression, cumulative), and manages aggregation across different time granularities. The package compiles metric requests into a dataflow-based query plan, optimizes it, and renders engine-specific SQL.
MetricFlow is designed to work within the dbt ecosystem as a query compilation and SQL rendering library. It requires a working dbt project and dbt adapter to function. The package depends on 12 runtime libraries including jinja2, pydantic, sqlglot, and pyyaml to handle templating, validation, SQL parsing, and configuration. It supports Python 3.10 through 3.14 and is actively maintained.
Use it for
- Define metrics once in code and automatically generate consistent SQL queries across multiple data warehouses.
- Build complex ratio metrics, cumulative metrics, and expressions that depend on multiple fact and dimension tables.
- Aggregate metrics to different time granularities without rewriting query logic.
- Maintain a centralized semantic layer for metrics used across analytics, BI tools, and reporting dashboards.
- Integrate metric definitions into version-controlled, testable metric logic within existing workflows.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to centralize metric logic in code.
MetricFlow is actively maintained, has no known vulnerabilities, carries a permissive Apache-2.0 license, and installs with low friction. It solves a real problem—metric consistency and reusability—but requires a dbt project and adapter to work, so it is not a standalone tool. Best suited for teams already invested in dbt.
Install
metricflow on PyPI
Before you install
Low install friction with a pure Python wheel. Active maintenance with a release 2 days ago. Supports Python 3.10 through 3.14. Requires a working dbt project and dbt adapter to function; optional system dependencies include Postgres and Graphviz.
Requires a working dbt project, a dbt adapter, and optionally Postgres or Graphviz installed on the system.
License in practice
Apache-2.0 permissive license. Version 0.212.0 is covered by Apache-2.0 (versions 0.209.0 and greater); earlier versions were under AGPL or BSL, so this version carries no copyleft obligations.
Quickstart
pip install metricflow
import metricflow
# Requires a working dbt project and dbt adapter configured before use
Verify before relying
- Whether the package can be used standalone or strictly requires dbt project integration for all operations.
- Performance characteristics and scalability limits for large metric definitions or complex joins.
- Whether Postgres and Graphviz are required or only needed for specific features.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release <3.15,>=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 12 packagesimportlib-metadatajinja2jsonschemamore-itertoolspydanticpython-dateutilpyyamlrapidfuzzreferencingsqlglottabulatetyping-extensions |
| Maintenance | Actively maintained 2 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,310,188 / month, #2,335 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy |
Evidence: metricflow-0.212.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “metric definition to SQL compiler”
- metricflowMetricFlow compiles metric definitions into reusable SQL queries,…
- dbt-metricflowBundles dbt-core and MetricFlow with compatible versioning, allowing…
- peakrdl-cheaderGenerates C header files from SystemRDL register models, converting…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also dbt-metricflow · dbt-semantic-interfaces · dbt-core · dbt-sl-sdk · dbt-bigquery · azure-monitor-querymetrics · dbt-trino · aws-embedded-metrics · dbt-osmosis · airflow-dbt