Graphviz utility functions.
Latest release 20220827:
- Remove dependency on cs.lex - now we need only the stdlib.
- New GVCAPTURE value for gvprint(file=) to return the binary image data as a bytes object; associated gvdata() convenience function.
- New GVDATAURL value for gvprint(file=) to return the binary image data as a data URL; associated gvdataurl() convenience function.
See also the [https://www.graphviz.org/documentation/](graphviz documentation)
and particularly the [https://graphviz.org/doc/info/lang.html](DOT language specification)
and the [https://www.graphviz.org/doc/info/command.html](dot command line tool).
Class DOTNodeMixin
A mixin providing methods for things which can be drawn as nodes in a DOT graph description.
Function gvdata(dot_s, **kw)
Convenience wrapper for gvprint which returns the binary image data.
Function gvdataurl(dot_s, **kw)
Convenience wrapper for gvprint which returns the binary image data
as a data: URL.
Function gvprint(dot_s, file=None, fmt=None, layout=None, **dot_kw)
Print the graph specified by dot_s, a graph in graphViz DOT syntax,
to file (default sys.stdout)
in format fmt using the engine specified by layout (default 'dot').
If fmt is unspecified it defaults to 'png' unless file
is a terminal in which case it defaults to 'sixel'.
In addition to being a file or file descriptor,
file may also take the following special values:
GVCAPTURE: causesgvprintto return the image data asbytesGVDATAURL: causesgvprintto return the image data as adata:URL
This uses the graphviz utility dot to draw graphs.
If printing in SIXEL format the img2sixel utility is required,
see https://saitoha.github.io/libsixel/.
Example:
data_url = gvprint('digraph FOO {A->B}', file=GVDATAURL, fmt='svg')
produces a data: URL rendering as:
Function quote(s)
Quote a string for use in DOT syntax. This implementation passes identifiers and sequences of decimal numerals through unchanged and double quotes other strings.
Release Log
Release 20220827:
- Remove dependency on cs.lex - now we need only the stdlib.
- New GVCAPTURE value for gvprint(file=) to return the binary image data as a bytes object; associated gvdata() convenience function.
- New GVDATAURL value for gvprint(file=) to return the binary image data as a data URL; associated gvdataurl() convenience function.
Release 20220805.1: New DOTNodeMixin, a mixin for classes which can be rendered as a DOT node.
Release 20220805: Initial PyPI release.
Release files for cs-gvutils 20220827
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cs.gvutils-20220827.tar.gz | 5.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cs.gvutils-20220827-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.4 kB
Release files / cs.gvutils-20220827.tar.gz
| Download URL | cs.gvutils-20220827.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
04efda6968abb79a84dfd0b65db14a09c6bf3aa13e72aa6f926154cbaca0147b
|
|
BLAKE2b-256 checksum How to use checksums |
139164fb0c7bd52c25afd4b990878e7520b11237fcc0b2881149a8ef1d26332a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.1 readme-renderer/30.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.2 keyring/23.3.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.13
|
Release files / cs.gvutils-20220827-py3-none-any.whl
| Download URL | cs.gvutils-20220827-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a5de7a0742f27dd458a3658176def7f659004f1eedd82e9188528a9c0dad4726
|
|
BLAKE2b-256 checksum How to use checksums |
5a72a46fde43fbb85e887837e4e272ffb87b4bac6b221b74895f1215453af162
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.1 readme-renderer/30.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.2 keyring/23.3.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.13
|