Zenlytic Adapters
Utilities for converting semantic layer YAML files to Zenlytic's format.
Steps for usage:
- Run
pip install metricflow-to-zenlytic
$ metricflow_to_zenlytic [DIRECTORY]
from the command line, where [DIRECTORY]
is the directory your dbt_project.yml
file is in.
Usage in Python
To run the function in python you can do so like this:
from metricflow_to_zenlytic.metricflow_to_zenlytic import (
load_mf_project,
convert_mf_project_to_zenlytic_project,
)
# Load the metricflow project
metricflow_project = load_mf_project(metricflow_folder)
# Convert to Zenyltic models and views
models, views = convert_mf_project_to_zenlytic_project(metricflow_project, "my_model", "my_company")
# Save as yaml files
out_directory = '/save/to/here/'
zenlytic_views_to_yaml(models, views, out_directory)
Testing
$ pytest