Skip to main content

DVC render

Project description

PyPI Status Python Version License

Tests Codecov pre-commit Black

dvc-render is a library for rendering data stored in DVC plots format into different output formats, like Vega. It can also generate HTML and MarkDown reports containing multiple plots.

It is used internally by DVC, DVCLive, and Studio.

Features

  • Renderers

Take data stored in DVC plots format alongside plot properties in order to render a plot in different formats.

  • Reports

Take multiple renderers and build an HTML or MarkDown report.

  • Templates

Support for rendering Vega plots using custom of pre-defined templates.

Requirements

The basic usage of rendering Vega Plots doesn’t have any dependencies outside Python>=3.8.

Additional features are specified as optional requirements:

https://github.com/iterative/dvc-render/blob/49b8f8a81c4e06b8f675197b8dd57e2a773cf283/setup.cfg#L27-L32

Installation

You can install DVC render via pip from PyPI:

$ pip install dvc-render

Usage

  • Renderer & Templates

from dvc_render import VegaRenderer
properties = {"template": "confusion", "x": "predicted", "y": "actual"}
 datapoints = [
     {"predicted": "B", "actual": "A"},
     {"predicted": "A", "actual": "A"},
 ]

renderer = VegaRenderer(datapoints, "foo", **properties)
plot_content = renderer.get_filled_template()

plot_content contains a valid Vega plot using the confusion matrix template.

  • Report

from dvc_render import render_html
render_html([renderer], "report.html")

Contributing

Contributions are very welcome. To learn more, see the Contributor Guide.

License

Distributed under the terms of the Apache 2.0 license, DVC render is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

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-render-0.6.0.tar.gz (32.7 kB view details)

Uploaded Source

Built Distribution

dvc_render-0.6.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file dvc-render-0.6.0.tar.gz.

File metadata

  • Download URL: dvc-render-0.6.0.tar.gz
  • Upload date:
  • Size: 32.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for dvc-render-0.6.0.tar.gz
Algorithm Hash digest
SHA256 69b7dfdadf890beb6d7fa5b3d4bd33323d78fc4c3ce33ed1bf777026192f9b4d
MD5 6c64d9c3059f8b38d12f8a792f037be3
BLAKE2b-256 9c5ea5a30613a1f069a50df71433c706ac209ae3e2cd3a8004e3ce91d26ecf29

See more details on using hashes here.

File details

Details for the file dvc_render-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: dvc_render-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for dvc_render-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2dc6c73d02538e9396475e146048e20242233d418967f82e0627e5caa3360303
MD5 5e89b0c20f0c0d4ee40d754b34e2ce36
BLAKE2b-256 e452675239b9451c327a462fc66a09f4c1c96a5b5d90faf566864e35e15a7791

See more details on using hashes here.

Supported by

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