Skip to main content

NetDiagrams

Network diagrams from your NetBox data, drawn to one consistent standard in draw.io.

You already keep your devices, cables, VLANs and sites in NetBox. NetDiagrams turns that data into a full set of drawings that look like an engineer drew them by hand: overview, logical, physical, hardware, wireless, flows, failover and multi-site sheets, each with registers and title blocks. Run it again whenever NetBox changes, and the drawings follow.

  • Works with free, self-hosted NetBox. It needs only a read-only API token.
  • Read-only. It sends GET requests to NetBox, never changes it unless you opt in with netbox-setup --apply, and never connects to your network devices.
  • No dependencies. Pure Python 3.9+, standard library only.
  • Opens anywhere draw.io does: the desktop app, diagrams.net, Confluence, or exported HTML.

Quick start

pip install git+https://github.com/segaudit-hq/netdiagrams-public
netdiagrams

The first run asks for your NetBox URL and an API token and remembers them. It then writes one drawing per NetBox site, <site>.drawio, plus a <site>.drift.md report of anything the template and NetBox disagree on. Open the drawing in draw.io.

No NetBox handy? See what a finished drawing looks like with a fictional site:

netdiagrams sample -o plant-a.drawio

The sample is only a demo. NetDiagrams never uses it unless you ask for it.

What you get

  • A drawing standard, not a random layout. NetDiagrams fills a bundled template, so every site comes out with the same sheets, shapes and colors. Your site's names replace the template's, and NetBox devices take the template slot of the same role.
  • Everything typed comes from NetBox. Device fields, management IPs, serials, modules and optics, circuits, VLAN tables per zone, asset and link registers, and title blocks. Every shape links back to its NetBox object.
  • Security zones you can see. Zones come from NetBox tags or custom fields, with a flow register of what is allowed between them.
  • Any size fits. Repeated cells and closets are drawn once as a TYPICAL with a schedule row per copy, so a 3,000-device site still prints on the same set of sheets.
  • Data quality, day to day. A quality sheet scores the site and lists what NetBox is missing. netdiagrams gaps writes the NetBox import files that fill those gaps.
  • Audit evidence. An optional sheet shows owners, compliance scope, backups, patching, support contracts and monitoring for every asset.
  • Safe to share. netdiagrams share makes a copy without IPs, serials, circuit IDs or NetBox links, ready to send to a vendor.

Industry profiles

Every kind of site groups its zones differently, so each industry has its own template, stencils and example site:

Profile For Book
manufacturing (default) Plants, with Purdue levels, an industrial DMZ and production cells Book 1
education School districts and campuses Book 2
warehouse Distribution centers, cross-docks and 3PL sites Book 3
retail Stores, with the payment zone kept apart Book 4
office Offices and branches Book 5
bank Banks and credit unions, with teller, wire and card zones and the core processor's link Book 6
municipal Cities, towns and counties, with police (CJIS), public Wi-Fi and the utility boundary kept apart Book 7
hotel Hotels, with payments, guests, guest rooms and building systems kept apart Book 8
corporate Headquarters campuses and multi-site companies, with VRFs, a data center and branch WAN Book 9
dealership Car dealerships, with F&I, the shop and the manufacturer's router kept apart Book 10
netdiagrams --profile retail
netdiagrams sample --profile retail

Common commands

Command What it does
netdiagrams Build drawings for every NetBox site (same as build)
netdiagrams doctor Check how your NetBox maps onto the template before drawing anything
netdiagrams netbox-setup Write NetBox import files for the zones, roles and custom fields the template uses (--apply creates them; nothing existing is changed)
netdiagrams gaps Write NetBox import files that close the data gaps the drawing lists
netdiagrams share Copy a drawing with sensitive details removed
netdiagrams draft Lay out a first draft automatically for a site with no drawing yet
netdiagrams blank / stencils Start by hand without NetBox, using the draw.io shape library
netdiagrams export / build --input Save NetBox data to JSON and build from it offline

If your NetBox uses its own role names or custom field names, map them in a small netdiagrams.json file. netdiagrams doctor --save-settings netdiagrams.json proposes one for you.

The full guide to every option, setting and sheet is in docs/reference.md.

Learn the method

The drawings follow a method for documenting segmented networks: what to draw on each sheet, how to name zones, and how to keep drawings current. It is written up as a series of ten industry guides at netdiagrams.com, one for each profile above, each with a free chapter and worksheets.

Once your zones are drawn, SegAudit checks that your firewall configuration actually enforces them.

Contributing

Bug reports and pull requests are welcome. Run the tests with:

PYTHONPATH=src python3 -m unittest discover -s tests

License

Apache License 2.0. See LICENSE and NOTICE. NetDiagrams is a product of SegAudit LLC.

Metadata

Release files for netdiagrams 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for netdiagrams 0.2.0
File Size Uploaded Provenance Actions
netdiagrams-0.2.0.tar.gz 1.7 MB With provenance Details for netdiagrams-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for netdiagrams 0.2.0
File Interpreter ABI Platform Actions
netdiagrams-0.2.0-py3-none-any.whl Python 3 none any Details for netdiagrams-0.2.0-py3-none-any.whl

Total release size: 3.4 MB

Release files / netdiagrams-0.2.0.tar.gz

Download URL netdiagrams-0.2.0.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
0cb0f5c9e77e3cee90c9f568171d709be1b5bc0c7c96d2e39935b17ba5edeffc
BLAKE2b-256 checksum
How to use checksums
269763d60a6a60083ba950d7129d4ae310b57261ee1b64c2ae1998acdcbfea22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / netdiagrams-0.2.0-py3-none-any.whl

Download URL netdiagrams-0.2.0-py3-none-any.whl
Size 1.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
f78a599e3a4e463a85a658570d7cef000a4df264f8a6beda8b1863ab1a849d0c
BLAKE2b-256 checksum
How to use checksums
78fd62d4e52ca233ec5b4a2bee8b1162f2bd7b35d4d45cddfbf2b3038e4f43f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for netdiagrams 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for netdiagrams-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page