Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ascii_network_diagram-0.1.9.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ascii_network_diagram-0.1.9-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

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

Hashes for ascii_network_diagram-0.1.9.tar.gz
Algorithm Hash digest
SHA256 d3b2f2ee7a668ca403fcb7bbf446bd15640a3500030696ffab2cfb0ec110ecad
MD5 175936758ce6eccc98769ec88642903f
BLAKE2b-256 6d9940c03972f58f933a8e15e0b7d5cfbd1c761e5559bfa4faf7a39965f87ff5

See more details on using hashes here.

Provenance

The following attestation bundles were made for ascii_network_diagram-0.1.9.tar.gz:

Publisher: publish.yml on joshuabettigole/ascii-network-diagram

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ascii_network_diagram-0.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for ascii_network_diagram-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 8f6347f66e188078135b2c257d6ca825a1f55a43e4c115ee6895067399c5979e
MD5 43ebb4dc078cf403eda84a6283bf9151
BLAKE2b-256 fa74d55a649f087f51067d41eb37f10efaf6ef52e6c14f158b6ae438e673775f

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page