🎉 NEW: Version 2.0.0-beta Now Available on TestPyPI!
- https://test.pypi.org/project/drawmate/
- Major Update: Complete rewrite from C++ to pure Python! No more complex build dependencies.
- 📦 Beta Testing:
pip install -i https://test.pypi.org/simple/ drawmate - 📋 See CHANGELOG.md for full details on what's new, improved, and fixed.
Drawmate is a powerful tool designed to automate the creation of wiremaps and network architecture diagrams using the Draw.io XML format. This tool streamlines the diagramming process by utilizing a JSON API to automatically generate basic wiremaps, saving time and effort for network engineers and IT professionals.
- 🚀 Automated Wiremap Generation: Generate network diagrams quickly using the JSON API.
- 🌐 Versatile Use Cases: Ideal for network architecture visualization, infrastructure mapping, and dynamic diagram creation.
- JSON API Integration: Input network data through JSON to auto-generate wiremaps.
- Draw.io Compatibility: Export diagrams in Draw.io XML format for further customization or sharing.
Currently available on TestPyPI for beta testing:
pip install -i https://test.pypi.org/simple/ drawmateOnce testing is complete, the package will be available on the official PyPI:
pip install drawmate # Coming soon!- No build dependencies - No more CMake or C++ compiler requirements
- No architecture-specific builds - Works across multiple platforms
- Simple installation - Standard pip workflow
- Easy updates -
pip install --upgrade drawmate
usage: drawmate [-h] [-v] [-b] [-t] [-l] [-gt] [input_file] [output_file]
positional arguments:
input_file The path to the JSON template file. See API documentation for how to format the
input file. Alternatively, pass in the '-b' or '--build-template' flag to get a
blank starter template in the correct format
output_file The path to the drawio.xml output file. Acceptable file extensions are
['.drawio', '.xml', '.drawio.xml']. Drawio will accept any of those three. You
can also pass in the '-t' or '--timestamp' flag to append a timestamp to the
file.
options:
-h, --help show this help message and exit
-v, --version Print drawmate version, as well as system information
-b, --build-template Interactive guide to build a starter JSON template with valid structure and
empty node data.
-t, --timestamp Add a timestamp to the output file
-l, --link-label Add labels to links based on node positions (e.g., '0101'). See docs for label
format.
-gt, --generate-test Generate a test JSON template and output Draw.io XML. Test files are saved to
~/.config/drawmate/tests.- 📍 Matrix Positioning: Set the starting
xandycoordinates for theMatrix. All connected nodes will be placed relative to this position. - 🚫 Signaling Gaps: If there is a gap between appliances, pass an empty string (
"") or the (__SPAN__) variable in the list.- Example: If the
Matrixhas 4 connections but only 3 appliances, include 4 connections in the list with a blank string or the (__SPAN__) variable representing the gap.
- Example: If the
- Connection/Flow: The arrows/connection currently flow left to right and I am working on a function to allow reversing the flow.
- Label Entries: Label entries in the JSON API follow this basic structure:
["Label of appliance", "input" | ["input", "input"], "output" | ["output", "output"], ["connection-indexes"], ["connection-indexes"]]connection-indexesrefers to the index location of the ports. Indexes follow the 0 indexing system, so if you have a Node at index 0, but it has two ports on each side, the indexes would be[0, 1].- You can alternatively pass in
["NONE"]and the engine will infer an adjacent connection based on the position of the Node/Port. I kept this design to allow for different routing mechanisms in the future. "connections-left/right"refers to the connections on the matrix itself
- Add more levels: To add more levels/columns, just use the same naming convention
second-level-left,third-level-leftand so on. - IMPORTANT: Make sure the value of
num_connectionsmatches the number of appliances in each entry.
{
"graph-dimensions": {
"dx": 4000,
"dy": 4000,
"width": 4000,
"height": 4000
},
"matrices": {
"labels": "Video/Audio Codec",
"width": 200,
"height": 400,
"x": 2000,
"y": 2000,
"num_connections": 4
},
"first-level-left": {
"labels": [
["AV Appliance", "HDMI", "HDMI", ["NONE"], ["NONE"]],
["AV Appliance", "HDMI", "HDMI", ["NONE"], ["NONE"]],
["AV Appliance", "HDMI", "HDMI", ["NONE"], ["NONE"]],
["AV Appliance", "HDMI", "HDMI", ["NONE"], ["NONE"]]
]
},
"first-level-right": {
"labels": [
["AV Audio", "MIC-IN", "OUT", ["NONE"], ["NONE"]],
["", "", "", ["NONE"], ["NONE"]], // 🚫 Gap between appliances
["AV Appliance", "HDMI", "HDMI", ["NONE"], ["NONE"]],
["AV Appliance", "HDMI", "HDMI", ["NONE"], ["NONE"]]
]
},
"connections-left": [
"HDMI",
"HDMI",
"HDMI",
"HDMI"
],
"connections-right": [
"MIC",
"HDMI",
"HDMI",
"HDMI"
]
}- This is a very simple implementation, with only one level of connections for a basic AV Codec.
- Here is a view of what the above JSON would output (the numbering system can easily be altered to fit specific use cases):
To see more examples, go to "data/images/" in the project directory.
- Aaron Newman
