Skip to main content

Convert graphviz (dot) files to draw.io / lucid (mxGraph) format. Beautiful and editable graphs in your favorite editor.

Project description

graphviz2drawio

PyPI - Version Anaconda-Server Badge homebrew version Lint and Test Ask DeepWiki CodeFactor Maintainability Rating

Convert graphviz (dot) files to draw.io / lucid (mxGraph) format. Beautiful and editable graphs in your favorite editor.

Installation

macOS

graphviz2drawio can be installed with Homebrew:

brew install graphviz2drawio

Linux

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.

Note that the graphviz library is required before installing this package.

Ubuntu / Debian

sudo apt update
sudo apt install pipx graphviz graphviz-dev
pipx install graphviz2drawio
# To update: pipx upgrade graphviz2drawio

Fedora

sudo dnf install pipx
pipx ensurepath
pipx install graphviz2drawio
# To update: pipx upgrade graphviz2drawio

Anaconda

conda install conda-forge::graphviz2drawio

Usage

Run the conversion app on your graphviz file. For example, the command below will create converted files example1.xml and example2.xml.

graphviz2drawio example1.dot example2.dot

Alternatively, you can specify the output file (but only if there is a single input file)

graphviz2drawio example.dot -o /path/to/somewhere/new_name.xml

Output can also be sent to stdout by using the --stdout flag.

Graphs can be piped in from stdin and sent to stdout (default) or to a file with -o ....

Library Usage

from graphviz2drawio import graphviz2drawio

graph_to_convert = ...
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

Contributing

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

To see architectural and process diagrams please visit the deepwiki page

Thanks to all the people who have contributed to this project!

Profile images of all the contributors

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

Legal

© Harold Martin - released under GPLv3

diagrams.net is a trademark and draw.io is a registered trademark of JGraph Limited.

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

graphviz2drawio-1.1.0.tar.gz (43.0 kB view details)

Uploaded Source

Built Distribution

graphviz2drawio-1.1.0-py3-none-any.whl (42.2 kB view details)

Uploaded Python 3

File details

Details for the file graphviz2drawio-1.1.0.tar.gz.

File metadata

  • Download URL: graphviz2drawio-1.1.0.tar.gz
  • Upload date:
  • Size: 43.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for graphviz2drawio-1.1.0.tar.gz
Algorithm Hash digest
SHA256 8758b9eefbac5d8c03a0358c0158845235c9c3caa99887f0f6026cfecc2895f2
MD5 1d68958090000a758edecfd0453b35e9
BLAKE2b-256 fbe92ba4114579f8e708b6b5d671afe355c9b8cdd52b15a9d126ec188a2bcad6

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphviz2drawio-1.1.0.tar.gz:

Publisher: publish.yml on hbmartin/graphviz2drawio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file graphviz2drawio-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for graphviz2drawio-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e3b039830b39ad380d335fdca2649b77c1700064f6b8d30fdc62f04de8270e04
MD5 7f939eea6fe0415d771b398de9addf40
BLAKE2b-256 c41437a621df55974579164067cee94b647ca0665224ced6fb25e634f446e722

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphviz2drawio-1.1.0-py3-none-any.whl:

Publisher: publish.yml on hbmartin/graphviz2drawio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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