Skip to content

Convert graphviz (dot) files into draw.io (mxGraph) format

License

Notifications You must be signed in to change notification settings

laurierloi/graphviz2drawio

 
 

Repository files navigation

graphviz2drawio

pypi Build Status codecov.io

Convert graphviz (dot) files into draw.io (mxGraph) format

Getting Started

Prerequisites

graphviz2drawio requires Python 3 and Graphviz

  • On Mac OS these can be installed with Homebrew:
brew update; brew install python3 graphviz
pip3 install pygraphviz --install-option="--include-path=/usr/local/include/graphviz" --install-option="--library-path=/usr/local/lib/graphviz/"
  • On Ubuntu / Debian based Linux, install graphviz using:
sudo apt install python3-pip graphviz graphviz-dev

If you encounter installation errors you may need to manually install pygraphviz with links to the graphviz libraries

Installation / Upgrade

pip3 install graphviz2drawio --upgrade

Usage

Run the conversion app on your graphviz file

graphviz2drawio example.dot

You can them import the output XML file into draw.io

Python Usage

from graphviz2drawio import graphviz2drawio

xml = graphviz2drawio.convert(graph_to_convert)
print(xml)

where graph_to_convert can be any of a file path, file handle, string of dot language, or PyGraphviz.AGraph object

Limitations

Please open an issue with your dot file to report crashes or incorrectect conversions.

Built With

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Code Formatting

This project is linted with pyflakes and makes strict use of Black for code formatting.

Authors

License

GPLv3

About

Convert graphviz (dot) files into draw.io (mxGraph) format

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.1%
  • Makefile 3.9%