Convert graphviz (dot) files into draw.io / lucid (mxGraph) format
Project description
graphviz2drawio
Convert graphviz (dot) files into draw.io / lucid (mxGraph) format.
Prerequisites
The graphviz library is required before installing this package.
macOS
Python 3 and graphviz can be installed with Homebrew:
brew update
brew install python3 graphviz
# In order to build pygraphviz:
export CFLAGS="-I$(brew --prefix graphviz)/include/"
export LDFLAGS="-L$(brew --prefix graphviz)/lib/"
Ubuntu / Debian
sudo apt install python3-pip graphviz graphviz-dev
Installation
It is recommended to use pipx to install and run the CLI tool. If you wish to use the library, you can install with pip
instead.
brew install pipx
pipx install graphviz2drawio
Usage
Run the conversion app on your graphviz file
graphviz2drawio example.dot
You can then import the output XML file into draw.io or lucidchart.
Library 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
Built With
- PyGraphviz - Python interface to Graphviz
- svg.path - SVG path objects and parser
Contributing
Pull requests and issue reports are welcome. For major changes, please open an issue first to discuss what you would like to change.
Development Setup
git clone git@github.com:hbmartin/graphviz2drawio.git
cd graphviz2drawio
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Replace with the actual path to your dot files
python -m graphviz2drawio test/directed/hello.gv.txt
Roadmap to 0.5
- Migrate to uv/hatch for packaging and dep mgmt
- Turn on master branch protection
- Text alignment inside of shape
- Port layout/orientation
- Support for fill gradient
License
© Harold Martin - released under GPLv3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for graphviz2drawio-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6308a7d1d3bb73a9439bc0c59649804fc08045e491bfdcf24610b98f4a471ef |
|
MD5 | 183e3e922f819132dc968359f1ed5e62 |
|
BLAKE2b-256 | 157af5158e769b3585f4550f9639e01bb34f28f765026acefd5d0e9d9c51ccf9 |