Turn a YAML homelab inventory into a detailed redacted network diagram with this free MIT-licensed Python script. Documented and tested on Linux; other operating systems have not been verified.
homelab-diagram is a free, open-source Python script for turning a structured homelab inventory into a detailed network map. Instead of drawing every box manually, you describe VLANs, routers, switches, servers, virtual machines, containers, storage pools and port forwards in inventory.yaml. The included build.py then renders a large SVG diagram and can convert it to PNG when rsvg-convert is installed.
The visual style follows the dense network diagrams popular on r/homelab. Cable width represents link speed, trunk connections have their own treatment, VLANs use colored markers, and the sample layout includes a legend, networks table, exposed-services panel and storage details. A redaction mode is enabled by default so the generated image replaces the configured domain with redacted.com and uses generic SSID names.
The project is best understood as a strong starting point rather than a finished diagramming product. The inventory content is data-driven, but the visual layout is hand-placed in the Python code for the author's own network. Adapting it to a different lab may require changing coordinates and card sizes. There is no numbered release; the public repository was created on November 7, 2026, and the main branch is the distribution channel.
In a Freewares test on November 14, 2026, a fresh clone rendered the included sample inventory to a redacted 2400 by 2326 SVG after fetching 63 optional service icons. The built-in PNG step required rsvg-convert, which was not installed in that test environment, so the SVG was converted separately with ImageMagick for inspection.
Linux is the documented and tested environment. Windows or macOS may be possible when Python, PyYAML, librsvg and the required fonts are available, but the README does not provide install steps for those systems.
Describe VLANs, routers, switches, servers, virtual machines, containers, storage and port forwards in one YAML file.
The included sample renders a 2400 by 2326 SVG with link speeds, VLANs, trunks, storage and exposed services.
Yes. The code and the author's small glyph icons are published under the MIT license. Optional service icons are downloaded from a separate dashboard-icons project and keep their original rights.
Only partly. By default the render replaces the configured domain with redacted.com and uses generic SSID names, but IP addresses, hostnames, open ports and the topology remain visible.