Skip to main content

Generate a clear diagram of your DVC pipeline.

Project description

dvc-dag

Generate a readable PNG diagram of your DVC pipeline.


Example DVC DAG

Overview

The bundled dvc dag command is useful, but larger pipelines quickly become hard to read.

dvc-dag renders the pipeline as a PNG and applies a few readability improvements:

  • trims transitive edges
  • collapses parameterized stages when requested
  • simplifies displayed paths
  • uses colors and shapes to distinguish nodes

Requirements

dvc-dag supports Python 3.10 and newer.

dvc-dag must be run inside a Git repository initialized with DVC.

It also requires Graphviz on your PATH, specifically the dot and tred executables.

Install Graphviz with your system package manager:

Installation

Install the package from PyPI:

pip install dvc-dag

Or install it as an isolated CLI:

pipx install dvc-dag

Usage

Generate a PNG in the current DVC repository:

dvc-dag

Show all options:

dvc-dag --help

Show the installed version:

dvc-dag --version

Collapse parameterized stages:

dvc-dag --collapse-stage "train-candidate-models=family"

The --collapse-stage format is:

stage_name=parameter_name
path/to/dvc.yaml:stage_name=parameter_name

CLI Options

  • --out PATH Write the generated PNG to PATH. Parent directories are created automatically. Default: dvc_dag.png.
  • --delete-text TEXT Remove repeated path fragments from displayed node labels to keep the graph readable. Pass it multiple times to strip more than one fragment.
  • --collapse-stage RULE Collapse a parametrized stage into a single node. Use stage_name=parameter_name or path/to/dvc.yaml:stage_name=parameter_name. The collapsed label is rendered as stage_name@{parameter_name}.
  • --colors-random-seed INTEGER Control the color assignment for graph nodes. Use the same seed to keep colors stable across runs. Default: 42.
  • --debug Show full tracebacks instead of the default concise runtime errors.
  • --version Print the installed dvc-dag version and exit.
  • --help Show the full command help generated by Typer.

Typical example:

dvc-dag \
  --out docs/dvc_dag.png \
  --delete-text "pipelines/" \
  --delete-text "stages/" \
  --collapse-stage "train-candidate-models=family"

Troubleshooting

  • DVC was not found: install dvc and ensure it is on your PATH.
  • Not inside a DVC repository: run dvc init in the project first.
  • Graphviz dot/tred was not found: install Graphviz and ensure both tools are on your PATH.

Development

The repository includes a committed DVC fixture project under tests/fixtures/ for end-to-end testing.

You can try the CLI manually against the committed fixture project:

cd tests/fixtures/dvc_project
uv run dvc-dag --out /tmp/dvc_project_dag.png

Or render the fixture DAG straight from the repository root:

make dag

make dag is the supported way to refresh the demo DAG. It regenerates the fixture image and then syncs docs/dvc_project_dag.png for the README.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dvc_dag-0.1.0.tar.gz (211.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dvc_dag-0.1.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file dvc_dag-0.1.0.tar.gz.

File metadata

  • Download URL: dvc_dag-0.1.0.tar.gz
  • Upload date:
  • Size: 211.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dvc_dag-0.1.0.tar.gz
Algorithm Hash digest
SHA256 35fe8d83db32672ca7c5eebf00c77f1eeafb1f61e0c02946e71168fc99e95c6e
MD5 f54208622f2ea5fe0cb35842801152ed
BLAKE2b-256 a3cdf9cedb061e4b8cccd2ec8eb16eb8449dde774714d5d0825b84b35ffcc5a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for dvc_dag-0.1.0.tar.gz:

Publisher: publish.yml on AndreaVidali/dvc-dag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dvc_dag-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dvc_dag-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dvc_dag-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c3cf201c22db0ebd7368fe88177ecdb3535da84860035534ebcf200a354822ed
MD5 b22df80903692e7d9ca3fbb0e5d15679
BLAKE2b-256 31ffcaad84950af0cb78ac8dd59907b1e8c59148dade8a68b7253f349da661a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for dvc_dag-0.1.0-py3-none-any.whl:

Publisher: publish.yml on AndreaVidali/dvc-dag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page