Metadata-Version: 2.1
Name: metricflow
Version: 0.130.1
Summary: Translates a simple metric definition into reusable SQL and executes it against the SQL engine of your choice.
Home-page: https://transform.co/metricflow
License: AGPL-3.0-or-later
Author: Transform
Author-email: hello@transformdata.io
Requires-Python: >=3.8,<3.10
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Provides-Extra: dbt-bigquery
Provides-Extra: dbt-postgres
Provides-Extra: dbt-redshift
Provides-Extra: dbt-snowflake
Requires-Dist: GitPython (>=3.1.27,<4.0.0)
Requires-Dist: Jinja2 (>=2.11.3)
Requires-Dist: MarkupSafe (==2.0.1)
Requires-Dist: PyYAML (>=6.0,<7.0)
Requires-Dist: SQLAlchemy (>=1.4.27,<2.0.0)
Requires-Dist: click (>=7.1.2)
Requires-Dist: croniter (>=1.3.4,<2.0.0)
Requires-Dist: databricks-sql-connector (==2.0.3)
Requires-Dist: dbt-bigquery (>=1.3.0,<2.0.0); extra == "dbt-bigquery"
Requires-Dist: dbt-postgres (>=1.3.0,<2.0.0); extra == "dbt-postgres"
Requires-Dist: dbt-redshift (>=1.3.0,<2.0.0); extra == "dbt-redshift"
Requires-Dist: dbt-snowflake (>=1.3.0,<2.0.0); extra == "dbt-snowflake"
Requires-Dist: duckdb (==0.3.4)
Requires-Dist: duckdb-engine (>=0.1.8,<0.2.0)
Requires-Dist: fuzzywuzzy (>=0.18.0,<0.19.0)
Requires-Dist: google-cloud-bigquery (==2.34.2)
Requires-Dist: graphviz (==0.18.2)
Requires-Dist: halo (>=0.0.31,<0.0.32)
Requires-Dist: jsonschema (==3.2.0)
Requires-Dist: more-itertools (==8.10.0)
Requires-Dist: moz-sql-parser (>=4.40.21126,<5.0.0)
Requires-Dist: numpy (>=1.22.2)
Requires-Dist: pandas (>=1.3.0,<2.0.0)
Requires-Dist: psycopg2 (>=2.9.3,<3.0.0)
Requires-Dist: pycron (>=3.0.0,<4.0.0)
Requires-Dist: pydantic (>=1.9.0,<2.0.0)
Requires-Dist: python-Levenshtein (>=0.12.2,<0.13.0)
Requires-Dist: python-dateutil (==2.8.2)
Requires-Dist: requests (>=2.27.1,<3.0.0)
Requires-Dist: ruamel.yaml (>=0.17.21,<0.18.0)
Requires-Dist: rudder-sdk-python (>=1.0.3,<2.0.0)
Requires-Dist: snowflake-connector-python (>=2.7.8)
Requires-Dist: snowflake-sqlalchemy (==1.2.3)
Requires-Dist: sqlalchemy-bigquery (>=1.4.3,<2.0.0)
Requires-Dist: sqlalchemy-redshift (==0.8.1)
Requires-Dist: sqlalchemy2-stubs (>=0.0.2-alpha.21,<0.0.3)
Requires-Dist: tabulate (==0.8.9)
Requires-Dist: typing_extensions (>=4.0.0)
Requires-Dist: update-checker (>=0.18.0,<0.19.0)
Requires-Dist: yamllint (>=1.26.3,<2.0.0)
Project-URL: Repository, https://github.com/transform-data/metricflow
Description-Content-Type: text/markdown

<p align="center">
  <a target="_blank" href="https://transform.co/metricflow">
    <picture>
      <img  alt="metricflow logo" src="https://github.com/transform-data/metricflow/raw/main/assets/MetricFlow_logo.png" width="auto" height="120">
    </picture>
  </a>
  <br /><br />
  <b>Build and maintain all of your metric logic in code.</b>
  <br /><br />
  <a target="_blank" href="https://twitter.com/transformio">
    <img src="https://img.shields.io/twitter/follow/transformio?labelColor=image.png&color=163B36&logo=twitter&style=flat">
  </a>
  <a target="_blank" href="http://community.transform.co/metricflow-signup">
    <img src="https://img.shields.io/badge/Slack-join-163B36">
  </a>
  <a target="_blank" href="https://github.com/transform-data/metricflow">
    <img src="https://img.shields.io/github/stars/transform-data/metricflow?labelColor=image.png&color=163B36&logo=github">
  </a>
  <br />
  <a target="_blank" href="https://github.com/transform-data/metricflow/blob/master/LICENSE">
    <img src="https://img.shields.io/pypi/l/metricflow?color=163B36&logo=AGPL-3.0">
  </a>
  <a target="_blank" href="https://pypi.org/project/metricflow/">
    <img src="https://img.shields.io/pypi/v/metricflow?labelColor=&color=163B36">
  </a>
  <img src="https://img.shields.io/pypi/pyversions/metricflow?labelColor=&color=163B36">
</p>

# Welcome to MetricFlow

See our latest updates in the [Metricflow Changelog](https://github.com/transform-data/metricflow/blob/main/CHANGELOG.md)!

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.

<p align="center">
<img src="https://github.com/transform-data/metricflow/raw/main/assets/example_plan.svg" height="500"/>
<br /><br />
</p>

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](https://docs.transform.co/docs/metricflow/guides/introduction).

## 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](https://www.postgresql.org/download/) or [Graphviz](https://www.graphviz.org/download/). 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](https://docs.transform.co/docs/metricflow/metricflow-tutorial) steps:

```
mf tutorial
```

There are several examples of MetricFlow configs on common data sets in the [config-templates](/Users/nicholashandel/repositories/metricflow/config-templates) folder. The tutorial will rely on a small set of [sample configs](/Users/nicholashandel/repositories/metricflow/metricflow/cli/sample_models).

## Resources

- [Website](https://transform.co/metricflow)
- [Documentation](https://docs.transform.co/docs/overview/metricflow-overview)
- [Slack Community](https://community.transform.co/metricflow-signup)
- [MetricFlow Git Repository](https://github.com/transform-data/metricflow)
- [CHANGELOG.md](https://github.com/transform-data/metricflow/blob/main/CHANGELOG.md)
- [ROADMAP.md](https://github.com/transform-data/metricflow/blob/main/ROADMAP.md)
- [TENETS.md](https://github.com/transform-data/metricflow/blob/main/TENETS.md)

## 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](http://community.transform.co/metricflow-signup) and <LINK> engineering practices </LINK> before diving in.

To get started on direct contributions, head on over to our [contributor guide](https://github.com/transform-data/metricflow/blob/main/CONTRIBUTING.md).

## 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](https://transform.co/).

