$npx skillfedfor your agent

metricflow

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

With conditionsPyPI DatabaseReleased Aug 20264.3M downloads / moApache-2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — metricflow-0.212.0-py3-none-any.whl
v0.212.0 · released 2026-08-12 · Python <3.15,>=3.10 · 12 runtime deps: importlib-metadata, jinja2, jsonschema, more-itertools, pydantic, python-dateutil, pyyaml, rapidfuzz

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

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.
Same gist for agents: .md · .json

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.

With conditions

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

LicenseApache-2.0 permissive
Python supportSupports the current Python release <3.15,>=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
12 packages
importlib-metadatajinja2jsonschemamore-itertoolspydanticpython-dateutilpyyamlrapidfuzzreferencingsqlglottabulatetyping-extensions
MaintenanceActively maintained 2 days since the last release
Last repo commit
First released
Downloads4,310,188 / month, #2,335 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone 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

Capabilities
metric definition to SQL compilersemantic layer for metricsmetric query generationSQL metric compilationdata warehouse metric abstractiondimension-aware metric queriesmetric aggregation engine
Topics
sql-generationsemantic-layermetric-management

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 Worth it
PyPI · Software Development · released Apr 2026

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.

copyleftcompiled wheel · 3.9+
271.6Mdownloads / mo
redis Worth it
PyPI · Database · released Jul 2026

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.

MITpure Python · 3.10+
268.3Mdownloads / mo
ydb Worth it
PyPI · Database · released Jul 2026

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.

permissive licensepure Python · 3.10+
210.0Mdownloads / mo
snowflake-connector-python Worth it
PyPI · Software Development · released Aug 2026

Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.

Apache-2.0compiled wheel · 3.10+
193.6Mdownloads / mo
sqlparse Worth it
PyPI · Software Development · released Aug 2026

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.

BSD-3-Clausepure Python · 3.10+
148.9Mdownloads / mo
dbt-adapters With conditions
PyPI · Database · released Jul 2026

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.

Apache-2.0pure Python · 3.10.0+
121.3Mdownloads / mo

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

Further reading