A package for drawing ASCII network diagrams.
Project description
ascii-network-diagram
ascii-network-diagram is a Python package for generating visually appealing ASCII art network diagrams directly in your terminal. It is designed for quick visualization of star-topology networks, making it easy to share, document, or debug network layouts in plain text environments.
Key Features:
- Draws star network diagrams with 2 to 12 nodes.
- Each node can have a label (required), VLAN (optional), and connection/circuit ID (optional).
- VLAN and title are not required; the diagram will render without them.
- Automatically adjusts box sizes and layout for your node labels.
- Attempts to center the diagram in the terminal
- Output is pure ASCII/Unicode, suitable for terminals, documentation, and code comments.
- No external dependencies beyond Python standard library.
- Draws nodes in list-order from left-center in a counter-clockwise pattern
Limitations:
- There is no overflow handling. If the diagram is too wide for your terminal, it prints a warning:
[Warning] Diagram width exceeds terminal width. Consider shortening labels or reducing the number of nodes.
Usage Example:
from ascii_network_diagram import star_diagram
nodes = [
{"label": "node1.core, eth0", "vlan": 100, "connection": "CIR-100"},
{"label": "node2.core, eth1", "vlan": 100, "connection": "CIR-100"},
]
star_diagram(nodes, title="2 Node Star Diagram")
Output:
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ │
│ 2 Node Star Diagram │
│ │
├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ CIR-100 ──── (vlan 100) ────▶ │ node1.core, eth0 │ ◀═════════▶ │ node2.core, eth1 │ ◀──── (vlan 100) ──── CIR-100 │
│ └──────────────────┘ └──────────────────┘ │
│ │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Installation
pip install ascii-network-diagram
Usage
from ascii_network_diagram import star_diagram
nodes = [
{"label": "node1.core, eth0", "vlan": 100, "connection": "CIR-100"},
{"label": "node2.core, eth1", "vlan": 100, "connection": "CIR-100"},
]
star_diagram(nodes, title="2 Node Star Diagram")
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ascii_network_diagram-0.1.9.tar.gz.
File metadata
- Download URL: ascii_network_diagram-0.1.9.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3b2f2ee7a668ca403fcb7bbf446bd15640a3500030696ffab2cfb0ec110ecad
|
|
| MD5 |
175936758ce6eccc98769ec88642903f
|
|
| BLAKE2b-256 |
6d9940c03972f58f933a8e15e0b7d5cfbd1c761e5559bfa4faf7a39965f87ff5
|
Provenance
The following attestation bundles were made for ascii_network_diagram-0.1.9.tar.gz:
Publisher:
publish.yml on joshuabettigole/ascii-network-diagram
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ascii_network_diagram-0.1.9.tar.gz -
Subject digest:
d3b2f2ee7a668ca403fcb7bbf446bd15640a3500030696ffab2cfb0ec110ecad - Sigstore transparency entry: 1280956437
- Sigstore integration time:
-
Permalink:
joshuabettigole/ascii-network-diagram@821bb7ed904924a051b58c24dc189907d7f02460 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/joshuabettigole
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@821bb7ed904924a051b58c24dc189907d7f02460 -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file ascii_network_diagram-0.1.9-py3-none-any.whl.
File metadata
- Download URL: ascii_network_diagram-0.1.9-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f6347f66e188078135b2c257d6ca825a1f55a43e4c115ee6895067399c5979e
|
|
| MD5 |
43ebb4dc078cf403eda84a6283bf9151
|
|
| BLAKE2b-256 |
fa74d55a649f087f51067d41eb37f10efaf6ef52e6c14f158b6ae438e673775f
|
Provenance
The following attestation bundles were made for ascii_network_diagram-0.1.9-py3-none-any.whl:
Publisher:
publish.yml on joshuabettigole/ascii-network-diagram
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ascii_network_diagram-0.1.9-py3-none-any.whl -
Subject digest:
8f6347f66e188078135b2c257d6ca825a1f55a43e4c115ee6895067399c5979e - Sigstore transparency entry: 1280956440
- Sigstore integration time:
-
Permalink:
joshuabettigole/ascii-network-diagram@821bb7ed904924a051b58c24dc189907d7f02460 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/joshuabettigole
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@821bb7ed904924a051b58c24dc189907d7f02460 -
Trigger Event:
pull_request
-
Statement type: