Install & Compatibility
Where this runs
tested against v3.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 55.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.0s · import 0.000s · 57MB
58MB installed
● package 58MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
nwdiag
✓ import nwdiag
✗ from nwdiag import nwdiag
The package top-level is the module; use import nwdiag then call nwdiag.command()
parser
✓ from nwdiag import parser
✗ import parser
nwdiag.parser is the correct submodule, not the standard library parser
Generates a network diagram from a DOT-like text description.
import nwdiag
# Create a simple network diagram
nwdiag.command(['-o', 'output.png', '-']).stdout.write("""
nwdiag {
network dmz {
address = "192.168.1.0/24"
web01 [address = "192.168.1.1"];
web02 [address = "192.168.1.2"];
}
network internal {
address = "10.0.0.0/8";
db01 [address = "10.0.0.1"];
db02 [address = "10.0.0.2"];
}
}
""")
nwdiag --version
Errors
Common errors & fixes
ImportError: cannot import name 'nwdiag' from 'nwdiag'
Trying to import the submodule as 'from nwdiag import nwdiag' instead of 'import nwdiag'.
fixUse 'import nwdiag' and then call nwdiag.command() or other functions.
AttributeError: module 'nwdiag' has no attribute 'command'
Installed a different package named nwdiag (e.g., from a third-party) or used an older version where the API was different.
fixUninstall any conflicting package and install the official nwdiag: pip install --upgrade nwdiag
Parse error: syntax error, unexpected 'network'
Missing semicolon after closing brace of a network block, or incorrect nesting of networks.
fixCheck that every block ends with a semicolon. Example: 'network dmz { ... };' not 'network dmz { ... }' Upgrade
Version history
3.0.0latest on PyPI · released Dec 6, 2021
Audit
Dependencies
No dependency data recorded yet.