This release is a pre-release and may not be stable for production use.
data-graph
Lineage, checks and profiling for semantic layers written in Apache Ossie (incubating; formerly Open Semantic Interchange). An Ossie model names the datasets, fields, metrics and joins of a business's data; data-graph turns one into a graph and answers questions about it:
- lineage: what a metric is made of, down to source columns;
- impact: which metrics a change to a column, field or dataset touches;
- checks: unknown references, joins to undeclared datasets or fields, metrics over datasets with no join path, gaps;
- profiling: read-only, against the data behind the model;
- drawing and export: through zinet.
It is part of the digital-duck family: zinet for the graph format and drawing, dd-db for database access, GraphLang
for the LLM steps (the ask and ossie_draft recipes), beside app-graph, work-graph and concept-book. Prototype: version 0.1.0.dev1. See
docs/DEV/plan.md for the design and what comes next.
Install
pip install data-graf # once published; Python 3.11+
pip install -e ".[dev]" # from source; registers `dgr`
pytest
Names: the repository is data-graph; the PyPI package is data-graf, the import is datagraf and the command is dgr.
datagraph is already the import and command name of an unrelated package on PyPI (datagraph-core), and "graf"
matches GraphLang's graf.
Use
dgr validate model.yaml # JSON Schema for its Ossie version, then references and gaps (exit 1 on an error)
dgr show model.yaml # datasets, fields, metrics, joins
dgr lineage model.yaml total_sales # upstream, to source columns
dgr impact model.yaml store_sales.ss_ext_sales_price # downstream: the metrics it feeds
dgr check model.yaml # references and gaps, without the schema
dgr export model.yaml --format zinet -o lineage.graph.yaml # or --format json
dgr render model.yaml -o lineage.html # or --format mermaid / ascii / svg / png
dgr draft --sqlite shop.db -o shop.semantic_model.yaml # a skeleton from a SQLite catalogue
dgr profile model.yaml --sqlite shop.db # rows, nulls, distinct, ranges, metric values
With a model (GraphLang recipes; --llm ADAPTER[:MODEL], default claude_cli; ollama:llama3.2 runs locally):
dgr draft --sqlite shop.db --enrich -o shop.semantic_model.yaml # ossie_draft: the skeleton, then descriptions,
# synonyms and metrics, checked before it is written
dgr ask model.yaml "top 5 customers by money spent" --sqlite shop.db # ask: SQL checked against the model, run read-only
dgr bench benchmarks/chinook/questions.yaml --sqlite chinook.sqlite3 # the 24 Chinook questions, scored by running them
ask shows the model only the datasets the question needs: the ones it names, plus the join paths between them (--scope all shows everything). Its SQL must be one read-only statement over real tables and columns, and it must run; a failure
goes back to the model up to --max-repairs times, and a report says CHECKED or FAILED (a program decides which).
ossie_draft may add descriptions, synonyms, dimensions and metrics, but not change what the catalogue says; every
metric must run on the data, and the write sits behind a Cedar policy (an absolute path under your home or the temporary
folder, never over an existing file unless asked). Results on Chinook are in benchmarks/chinook.
A name is a metric (total_sales), a dataset-scoped metric or field (store_sales.total_quantity), a dataset, or a node
id (column:tpcds.public.store_sales.ss_quantity).
Both Ossie shapes are read: the released 0.1.1 (semantic_model: list, dialects expressions) and the 0.3.0 draft
(one model at the root, sql expressions). Each is checked against its own bundled schema.
examples/chinook.semantic_model.yaml is the Chinook sample database (the one
data-copilot used) as a finished model: drafted with dgr draft,
then given descriptions, synonyms and metrics by hand.
From Python
import datagraf as dg
model = dg.load("tpcds_semantic_model.yaml")
G = dg.build(model) # networkx DiGraph: source -> column -> field -> metric
up = dg.upstream(G, dg.resolve(G, "customer_lifetime_value"))
problems = dg.model_problems(model, G)
License
Apache-2.0. The Ossie schemas in src/datagraf/schemas/ and the example models in tests/fixtures/ come from
apache/ossie, also Apache-2.0; see NOTICE.
Metadata
Release files for data-graf 0.1.0.dev1
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 |
|---|---|---|---|---|
| data_graf-0.1.0.dev1.tar.gz | 85.2 kB | Without provenance | Details for data_graf-0.1.0.dev1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| data_graf-0.1.0.dev1-py3-none-any.whl | Python 3 | none | any | Details for data_graf-0.1.0.dev1-py3-none-any.whl |
Total release size: 135.7 kB
Release files / data_graf-0.1.0.dev1.tar.gz
| Download URL | data_graf-0.1.0.dev1.tar.gz |
|---|---|
| Size | 85.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d13b79f83fe5a803edb9da770f2a87d9040d0599dc5b1b9ad6e0cdb05f6bfea
|
|
BLAKE2b-256 checksum How to use checksums |
09c61cb56e7759566178b163b5f8a959136db20e8d2398f4e342e65d5c221d69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.17
|
Release files / data_graf-0.1.0.dev1-py3-none-any.whl
| Download URL | data_graf-0.1.0.dev1-py3-none-any.whl |
|---|---|
| Size | 50.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4887ceddf8d2fb1334ebd71a0788e5e8bfa3b1e798cb8498d77d1eb739bfc9d2
|
|
BLAKE2b-256 checksum How to use checksums |
9cb42986e10913f7a260bde1022aa6935d206e546714a02cb685b51ea881862d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.17
|
Security for data-graf 0.1.0.dev1
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.