Skip to main content
Pre-release

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 (planned), beside app-graph, work-graph and concept-book. Prototype: version 0.1.0.dev0. 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

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.dev0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for data-graf 0.1.0.dev0
File Size Uploaded Provenance Actions
data_graf-0.1.0.dev0.tar.gz 49.4 kB Without provenance Details for data_graf-0.1.0.dev0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for data-graf 0.1.0.dev0
File Interpreter ABI Platform Actions
data_graf-0.1.0.dev0-py3-none-any.whl Python 3 none any Details for data_graf-0.1.0.dev0-py3-none-any.whl

Total release size: 77.2 kB

Release files / data_graf-0.1.0.dev0.tar.gz

Download URL data_graf-0.1.0.dev0.tar.gz
Size 49.4 kB
Tags Source
SHA-256 checksum
How to use checksums
da3a0a31992a2ef8a5ca9ee921bc5201d7aa21ffb7e62e462ac1a67cabede2d5
BLAKE2b-256 checksum
How to use checksums
dacffde9fa52efd6fce3f0d3f65d50b42e3671a98ab634650736753713b6d360
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.dev0-py3-none-any.whl

Download URL data_graf-0.1.0.dev0-py3-none-any.whl
Size 27.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2249227dd97cae8ae0485ec0ca01437e14a496c824c10aec888cc5273d0c1d47
BLAKE2b-256 checksum
How to use checksums
b346401cae4293f19a641d100e51a6fcc8f1ee39dac5284cdc9d9e9a99f63f22
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.dev0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page