Skip to main content

Network topology visualization and analysis tool with comprehensive data validation

Project description

Netwlens - Network Topology Visualization

A Python package for network topology visualization and analysis with IP Fabric integration. Features comprehensive data validation, automatic root device selection, and intelligent topology discovery.

Smart Network Visualization

Site Topology Example

Installation

For Users

# Install with Poetry (recommended)
pip install poetry  # if you don't have Poetry installed
poetry add netwlens

# Or using pip
pip install netwlens

For Developers

# Clone the repository
git clone <repository-url>
cd netwlens

# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install with Poetry (recommended)
pip install poetry  # if you don't have Poetry installed
poetry install

# Or using pip
pip install -e .

Quick Start

from netwlens import DataCollector, DataVisualizer

# Collect site-specific network data
collector = DataCollector()
data_dir = collector.collect_site_data(
    site="London-3X",
    protocol="cdp",
    output="mynetwork"
)

# Or collect all inventory data (NEW!)
data_dir = collector.collect_data(
    site_name=None,  # None = all inventory
    protocol="cdp",
    output="all-network"
)

# Create visualization with automatic root selection (NEW!)
visualizer = DataVisualizer()
viz_path = visualizer.create_topology(
    input_dir=data_dir,
    # Automatically selects device with most connections
    format_type="svg"
)

CLI Usage

# Collect site-specific data
netwlens collect --site London-3X --protocol cdp --output mynetwork

# Collect all inventory data (NEW!)
netwlens collect --protocol cdp --output all-data

# Create visualization with auto root selection (NEW!)
netwlens visualize --input netwlens_data/mynetwork

# Create visualization with manual root selection
netwlens visualize --input netwlens_data/mynetwork --root core-switch

Output Structure

netwlens_data/
├── mynetwork/                      # Data collection output
│   ├── inventory.json              # Device inventory
│   ├── connections_raw.json        # Raw connections from IP Fabric
│   ├── connections_normalized.json # Processed connections (enriched + deduplicated)
│   └── topology/                   # Visualization output
│       ├── topology_hierarchical.svg
│       ├── topology_hierarchical.png
│       └── view_svg_topology.html

Key Features

🔄 Flexible Data Collection

  • Site-Specific Collection: Extract data for specific network sites
  • All Inventory Collection: Collect data from entire network infrastructure
  • Protocol Support: CDP, LLDP, and CEF protocols
  • Comprehensive Data Validation: Multi-layer validation ensures data quality (NEW!)
  • Backward Compatibility: Existing APIs preserved while adding new capabilities

🎯 Smart Visualization

  • Automatic Root Selection: Intelligently selects device with most connections as topology root
  • Data Quality Assurance: Automatic validation before visualization with detailed error reporting (NEW!)
  • Connectivity Analysis: Device relationship validation and protocol consistency checks (NEW!)
  • Manual Root Override: Specify custom root device when needed
  • Clean Orthogonal Layouts: Professional diagrams with 90-degree connections
  • Multiple Output Formats: SVG, PNG, and interactive HTML viewers
  • Smart Logging: Connection analysis, validation summary, and root selection rationale

🛡️ Data Validation (NEW!)

  • Multi-Layer Validation: File existence → JSON structure → Data quality → Visualization readiness
  • Quality Metrics: Connected vs isolated devices, missing device detection, protocol consistency
  • Early Error Detection: Comprehensive validation before expensive graph operations
  • Actionable Feedback: Clear error messages explaining exactly what needs to be fixed
  • Smart Warnings: Non-blocking issues like isolated devices are flagged appropriately

🏗️ Developer-Friendly

  • Simple API: Clean DataCollector and DataVisualizer classes
  • Robust Validation: Dedicated DataValidator class with comprehensive checks
  • CLI Interface: Modern subcommand-based command line tools with built-in validation
  • Package Installation: Standard pip install workflow
  • Comprehensive Documentation: Detailed API docs and examples

Requirements

  • Python 3.11+
  • IP Fabric access (for data collection)
  • Graphviz (for visualization)
  • Poetry (recommended) or pip

Configuration

Set your IP Fabric credentials in environment variables or .env file:

IPF_URL=https://your-ipfabric-instance.com
IPF_TOKEN=your-api-token

For detailed documentation, see the docs/ directory or visit the project repository.

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

netwlens-1.3.2.tar.gz (602.3 kB view details)

Uploaded Source

Built Distribution

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

netwlens-1.3.2-py3-none-any.whl (606.0 kB view details)

Uploaded Python 3

File details

Details for the file netwlens-1.3.2.tar.gz.

File metadata

  • Download URL: netwlens-1.3.2.tar.gz
  • Upload date:
  • Size: 602.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for netwlens-1.3.2.tar.gz
Algorithm Hash digest
SHA256 5d3ef63f9882af2dbbb2e21c6e158f5b2a2b5d2311af45240e1be303cc92a512
MD5 8b19bc18d8eef604e7885dcfcaadc0e8
BLAKE2b-256 e0edd831024341c175698e2c4625e2594148bed6db0c7c91b0f9da6d6b5da558

See more details on using hashes here.

File details

Details for the file netwlens-1.3.2-py3-none-any.whl.

File metadata

  • Download URL: netwlens-1.3.2-py3-none-any.whl
  • Upload date:
  • Size: 606.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for netwlens-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 759097c3863a1442d8d0ffd92d350a98dbe82c481c81d421ef488cec4ebc2812
MD5 4d448962b8033205a962c0aaf51bc12c
BLAKE2b-256 fb4fb74ee0006573ecb3c9473e2102fe4f9cb6f6792d007291583b7ee018f997

See more details on using hashes here.

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