datus-semantic-metricflow
MetricFlow adapter for Datus semantic layer.
Installation
pip install datus-semantic-metricflow
Dependencies (datus-metricflow, pydantic) will be installed automatically.
Requirements
- Python >= 3.12
Quick Start
import asyncio
from datus_semantic_metricflow import MetricFlowAdapter, MetricFlowConfig
config = MetricFlowConfig(
datasource="my_project",
config_path="/path/to/metricflow/config", # optional
)
adapter = MetricFlowAdapter(config)
async def main():
# List metrics
metrics = await adapter.list_metrics(limit=10)
for metric in metrics:
print(f"{metric.name}: {metric.description}")
# Get dimensions for a metric
dimensions = await adapter.get_dimensions("revenue")
for dim in dimensions:
print(f"{dim.name}: {dim.description}")
# Query metrics
result = await adapter.query_metrics(
metrics=["revenue", "orders"],
dimensions=["date", "region"],
limit=100,
)
print(f"Columns: {result.columns}")
print(f"Data: {result.data[:5]}")
asyncio.run(main())
Configuration
| Field | Type | Default | Description |
|---|---|---|---|
datasource |
str | Required | Datasource for this semantic layer instance |
config_path |
str | None | Path to MetricFlow configuration file |
timeout |
int | 300 | Query timeout in seconds |
db_config |
dict | None | Datus datasource config; Snowflake supports password or private_key / private_key_file with private_key_file_pwd plus optional role |
API
list_metrics(path=None, limit=100, offset=0)- List available metricsget_dimensions(metric_name, path=None)- Get dimensions for a metricquery_metrics(metrics, dimensions=[], ...)- Execute metric queriesvalidate_semantic()- Validate configuration files
Development
pip install -e ".[dev]"
pytest
Metadata
Release files for datus-semantic-metricflow 0.2.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| datus_semantic_metricflow-0.2.14.tar.gz | 27.9 kB | Without provenance | Details for datus_semantic_metricflow-0.2.14.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| datus_semantic_metricflow-0.2.14-py3-none-any.whl | Python 3 | none | any | Details for datus_semantic_metricflow-0.2.14-py3-none-any.whl |
Total release size: 58.2 kB
Release files / datus_semantic_metricflow-0.2.14.tar.gz
| Download URL | datus_semantic_metricflow-0.2.14.tar.gz |
|---|---|
| Size | 27.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cce6487fdb8dcf2059471c106baa43c09629703c073e0f526c41de72ed6560db
|
|
BLAKE2b-256 checksum How to use checksums |
4e35527619414f39e8ecd5177551d7dd995adbeb3c80b07d9fdf0fd3290299d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / datus_semantic_metricflow-0.2.14-py3-none-any.whl
| Download URL | datus_semantic_metricflow-0.2.14-py3-none-any.whl |
|---|---|
| Size | 30.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0a405a47b5f373c89107add4c4267564719dec8b6cbf8392d2a7b1b132fc9cd7
|
|
BLAKE2b-256 checksum How to use checksums |
77062b3261cf1f8c32eb77a65b9f24dabd6db91bdacad7b89487a019c6495b15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Security for datus-semantic-metricflow 0.2.14
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.