A Python package for syncing metric definitions with Eppo's API. Manage your Eppo metrics as code using YAML files. Documentation is available in Eppo's documentation page.
- Sync metrics and fact sources to Eppo
- Validate metric definitions locally
- Support for dbt models
- Dry-run capability for testing
- Prefix support for testing in shared workspaces
pip install eppo-metrics-sync
- Set required environment variables:
export EPPO_API_KEY="your-api-key"
export EPPO_SYNC_TAG="your-sync-tag" # optional
-
Create your metrics YAML files (see Documentation)
-
Run the sync:
python -m eppo_metrics_sync path/to/yaml/directory
python -m eppo_metrics_sync [OPTIONS] DIRECTORY
Options:
--dryrun
Validate files without syncing to Eppo--schema
Schema type: eppo (default) or dbt-model--sync-prefix
Prefix for fact/metric names (useful for testing)--dbt-model-prefix
Warehouse/schema prefix for dbt models
For detailed information about metric configuration and available options, see Eppo's documentation page.
fact_sources:
- name: Revenue
sql: |
SELECT ts, user_id, amount
FROM revenue_table
timestamp_column: ts
entities:
- entity_name: User
column: user_id
facts:
- name: Revenue
column: amount
metrics:
- name: Total Revenue
description: Sum of Total Purchase Value in Purchases Fact Table
entity: User
numerator:
fact_name: Revenue
operation: sum
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pytest tests
For package maintainers:
- Update version in
pyproject.toml
- Build the package:
python -m build
- The package will be automatically published to PyPI when a new release is created on GitHub.