Skip to main content

NetDiagrams

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

NetDiagrams is a free, open-source command-line tool that generates network diagrams from NetBox. 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.

How to draw a network diagram from NetBox

pip install netdiagrams
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.

How it compares to NetBox topology plugins

NetBox plugins such as netbox-topology-views and netbox_drawio are installed on the NetBox server and draw a topology from inside NetBox. NetDiagrams takes a different approach, and you can use it alongside them:

  • Nothing to install on NetBox. It runs on your laptop or a CI job and reads the REST API with a read-only token.
  • A finished document set, not one graph. Each site gets overview, logical, physical, hardware, wireless, flow, failover and multi-site sheets, with registers and title blocks.
  • Security zones first. Sheets are grouped by zone, such as Purdue levels for a plant or the cardholder data environment for a store, with a register of the flows allowed between zones.
  • Editable output. The result is an ordinary draw.io file you can annotate, print or attach to an audit.

FAQ

Does NetDiagrams need a NetBox plugin? No. It talks to the NetBox REST API from outside, so it works with NetBox you host yourself and with hosted NetBox, as long as you can create an API token. Both classic tokens and the newer nbt_ tokens work.

Can it draw a Purdue model or IEC 62443 zones and conduits diagram? Yes. The default manufacturing profile draws Purdue levels, the industrial DMZ and production cells, with a flow register for the conduits between zones.

Can it draw a PCI DSS segmentation diagram? Yes. The retail, hotel and bank profiles keep the payment and card zones apart and show what is allowed to cross into them.

Does it change anything in NetBox or on my network? No. It only reads from NetBox and never connects to network devices. The one exception is netbox-setup --apply, which you run on purpose and which only creates missing objects.

Is it free? Yes. NetDiagrams is open source under the Apache License 2.0. The industry guides that explain the method are sold separately, and each one has a free chapter.

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.1

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.1
File Size Uploaded Provenance Actions
netdiagrams-0.2.1.tar.gz 1.7 MB With provenance Details for netdiagrams-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 3.4 MB

Release files / netdiagrams-0.2.1.tar.gz

Download URL netdiagrams-0.2.1.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
4de45a630113b4435246a97312ff6e2129eb758bc0eaa6559cb418590e734c09
BLAKE2b-256 checksum
How to use checksums
c5e34f48a689bc676c00e42967b1ac87e5440d8320d5946b040ef4e10273c581
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 30, 2026.

Transparency log

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

Download URL netdiagrams-0.2.1-py3-none-any.whl
Size 1.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
269bebe090050791de2aa0a56b894d43b969da717fcbb1d61bb10296857ec3da
BLAKE2b-256 checksum
How to use checksums
6e8252e1298cdcf60960e7733c9fc794319a1bfc351cf025257580eeeb59c2fd
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 30, 2026.

Transparency log

Security for netdiagrams 0.2.1

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.1.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 30, 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.1 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