Registry / data / dvc-render

dvc-render

JSON →
library1.0.2pypypi✓ verified 28d ago

dvc-render is a Python library for rendering data stored in DVC plots format into various output formats, such as Vega. It also supports generating HTML and Markdown reports containing multiple plots. It is used internally by DVC, DVCLive, and DVC Studio. The current version is 1.0.2, with frequent patch and minor releases.

pip install dvc-render
INSTALL
IMPORT
SIG · DVC-RENDER
D
dvc-render
datapythonv1.0.2
Install
1.5s avg
Import
—
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.0.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.9MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

VegaRenderer
✓ from dvc_render.vega import VegaRenderer
✗ from dvc_render.vega import VegaRenderer

This example demonstrates how to create a VegaRenderer instance for a confusion matrix, retrieve its filled Vega-Lite template, and then generate a simple HTML report containing the plot.

from dvc_render import VegaRenderer, render_html properties = {"template": "confusion", "x": "predicted", "y": "actual"} datapoints = [ {"predicted": "B", "actual": "A"}, {"predicted": "A", "actual": "A"}, {"predicted": "B", "actual": "B"}, ] # Create a renderer for a single plot renderer = VegaRenderer(datapoints, "my_confusion_plot", **properties) # Get the Vega-Lite JSON specification plot_content = renderer.get_filled_template() print("Generated Vega-Lite:", plot_content[:100], "...") # Print first 100 chars # Generate an HTML report with the plot render_html([renderer], "report.html") print("Generated report.html")
Debug
Known issues
breakingThe 1.0.0 release standardized `plots` across DVC, Studio, and VS Code. Users with custom plot configurations defined for DVC versions prior to 1.0.0 may experience breaking changes or require updates to their `dvc.yaml` definitions.
fix
Review and update plot definitions in `dvc.yaml` to conform to the new 1.0+ standards. Consult DVC documentation for `dvc plots`.
affects: <1.0.0
gotchaUsing custom plot templates can be complex. Earlier versions (0.5.x, 0.7.0) had multiple fixes related to correctly parsing recursive dictionary structures, handling lists, and finding data anchors within custom templates. Ensure your custom templates strictly adhere to DVC's expected `dvc plots` schema to avoid rendering issues.
fix
Thoroughly test custom templates. Refer to DVC's official plot template documentation for best practices and supported structures. Ensure `dvc-render` is up to date to benefit from parsing improvements.
affects: <1.0.2
gotchadvc-render is designed to work with data in 'DVC plots format'. While the library can be used independently, its full utility and intended use cases are deeply integrated with the DVC ecosystem. Users expecting a generic, standalone plotting library might find it less flexible without the context of a DVC project.
fix
Understand DVC's plot definitions and data format expectations before using `dvc-render` for custom rendering solutions. Consider using DVCLive to automatically log data in a compatible format.
affects: All
Upgrade
Version history
1.0.2latest on PyPI · released Apr 10, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
33 hits · last 30 days
node
30
Amazon
1
OpenAI (training)
1
Resources
dvc-render — pip install dvc-render · libregistry