Skip to main content

dot2bgraph PyPI Travis (.com) Coveralls

dot2bgraph is a CLI utility to convert graphs in dot format to bgraph format, for visualization with tools like bgrapher.

dot2bgraph supports a subset of dot features, tailored specifically to those that convert neatly to bgraph format. Other dot attributes that do not correlate to attributes supported by bgraph (e.g., shapes, label positions, etc.) are ignored.

Installation

First, ensure that you have graphviz installed, since it is a dependency for pygraphviz which, in turn, is a dependency for dot2bgraph.

For example, in Ubuntu:

apt-get install graphviz graphviz-dev

Or in OSX:

brew install graphviz

For other platforms, see pygraphviz's INSTALL.txt

Then, install dot2bgraph:

pip install dot2bgraph

With MacOS you may need to prepend CFLAGS="-I$(brew --prefix graphviz)/include" LDFLAGS="-L$(brew --prefix graphviz)/lib"

Usage

By default an input "file.dot" is converted to bgraph JSON format, which is outputted to stdout:

dot2bgraph file.dot

If you instead wish to quickly look at the output as it would appear in a bgraph visualization tool, use -f png, i.e., "PNG format". For example:

dot2bgraph -f png file.dot

For creating a bgraph recursively from multiple dot files in a directory structure, use -R, e.g. for the following directory structure:

dotdir
├── file1.dot
└── subdotdir
    └── file2.dot

You can run:

dot2bgraph -R dotdir

To save the tool's output (in whichever format) to a file, use -o.

Development

Install

python3 -m venv .venv
source .venv/bin/activate
CFLAGS="-I$(brew --prefix graphviz)/include" LDFLAGS="-L$(brew --prefix graphviz)/lib" python3 -m pip install ".[dev]"

With MacOS you may need to prepend CFLAGS="-I$(brew --prefix graphviz)/include" LDFLAGS="-L$(brew --prefix graphviz)/lib"

Test

Pytest

python -m pytest -s --cov-report term-missing --cov=dot2bgraph

Mypy

python -m mypy -p dot2bgraph --config-file=mypy.ini

Profile

python -mcProfile -o dot2bgraph.prof dot2bgraph/__main__.py -f none <your_dot_file>

Metadata

Release files for dot2bgraph 0.1.2

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

Source distribution (sdist)

Source distribution for dot2bgraph 0.1.2
File Size Uploaded Provenance Actions
dot2bgraph-0.1.2.tar.gz 41.4 kB Without provenance Details for dot2bgraph-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dot2bgraph 0.1.2
File Interpreter ABI Platform Actions
dot2bgraph-0.1.2-py3-none-any.whl Python 3 none any Details for dot2bgraph-0.1.2-py3-none-any.whl

Total release size: 72.4 kB

Release files / dot2bgraph-0.1.2.tar.gz

Download URL dot2bgraph-0.1.2.tar.gz
Size 41.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cadcf129d46ed7aa02409ee0d8084681d12672b5d1e33e91b7aedd0da23de8e9
BLAKE2b-256 checksum
How to use checksums
022db638ab13ff4de6d6503f1d0c1aac86948b582bf93794dead56e7d919234a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/6.0.0 pkginfo/1.7.1 requests/2.28.2 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.19

Release files / dot2bgraph-0.1.2-py3-none-any.whl

Download URL dot2bgraph-0.1.2-py3-none-any.whl
Size 31.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51d93f7248b753ab8245df0e594ed7160d360e30e773dc8c7514105ab377611a
BLAKE2b-256 checksum
How to use checksums
7476cc736b63e4a9fce09da9096a3ef4301de31cc02ae3dda761c5f0ea609e57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/6.0.0 pkginfo/1.7.1 requests/2.28.2 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.19

Security for dot2bgraph 0.1.2

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