Skip to main content

Subnetting and network discovery tool

Project description

NetPulse Subnet Logo

NetPulse Subnet

High-performance, standalone Python library & CLI for IPv4 & IPv6 network calculations, FLSM splitting, and VLSM allocation.

PyPI version Python Versions License: MIT Code style: black


netpulse-subnet is a standalone network administration tool extracted from the larger NetPulse discovery suite. It is built to help network engineers programmatically calculate, partition, and optimize IPv4 and IPv6 address spaces natively in Python or directly from the terminal.

✨ Features

  • Dual-Stack Support (IPv4 & IPv6): The mathematical engine dynamically routes calculation requests to support huge 128-bit subnets securely with memory exhaustion safeguards.
  • Subnet Calculator (info): Deep visibility into IP boundaries, subnet masks, wildcard masks, and bitwise binary representation.
  • Fixed-Length Subnet Splitter (split): Flawlessly chunk large network blocks (FLSM) based on exact host requirements or target partition counts.
  • Variable-Length Planner (vlsm): Eliminate IP wastage. Pass an array of varying host requirements and mathematically sort them into the tightest fitting CIDR blocks dynamically.
  • Overlap & Conflict Detection (validate): Ingest massive lists of legacy subnets and instantly detect routing clashes using a high-speed O(N log N) line-sweep algorithm, while simultaneously calculating available free space within a parent block.
  • Route Summarization (summarize): Merge multiple discontiguous subnets into the tightest encompassing supernet. The tool warns about any routing "slack" space generated.
  • Namespace Packaging: Fully decoupled from netpulse-core. It functions as a lightweight script with minimal dependencies (only pydantic, typer, and fastapi).
  • REST API Enabled: Run the built-in FastAPI uvicorn wrapper to serve subnet calculation logic dynamically to web dashboards or automation scripts.

🚀 Quickstart

Installation

Install globally or locally via pip:

pip install netpulse-subnet

CLI Usage

# Calculate detailed subnet boundaries for an IP
netpulse-subnet info 192.168.1.50/24

# Split a class A network into equal /10 blocks
netpulse-subnet split 10.0.0.0/8 --subnets 4

# Optimize and allocate VLSM blocks from a /24 parent network
netpulse-subnet vlsm 192.168.1.0/24 --req "HR=120,Dev=50,Sales=20,Guest=10"

# Validate a list of subnets to ensure no overlap, and calculate free space
netpulse-subnet validate 192.168.1.0/24 192.168.1.128/25 --parent 192.168.1.0/23

# Summarize multiple networks into a supernet block
netpulse-subnet summarize 192.168.0.0/24 192.168.1.0/24 192.168.2.0/24 192.168.3.0/24

Python API Integration

Use our cleanly typed Pydantic models and logic natively inside your own tools:

from netpulse.subnet.services.subnet import calculate_subnet_info, allocate_vlsm, validate_subnets

# Retrieve detailed boundary models
info = calculate_subnet_info("192.168.1.50", "24")
print(f"Broadcast IP: {info.broadcast_address}")

# Validate for overlaps and free space
valid = validate_subnets(["10.0.0.0/24", "10.0.1.0/24"], parent_network="10.0.0.0/22")
print(f"Conflicts: {valid.has_overlaps}")
print(f"First free block: {valid.free_space[0]}")

📖 Documentation

For in-depth explanations, architectural decisions, and integration examples, dive into the documentation:

  • 🗺️ Usage Guide - Deep dive into CLI and REST API examples.
  • 🐍 API Reference - Documentation for the Python service layer and Pydantic models.
  • 🧠 Design & Algorithms - Read about the mathematical algorithms behind our FLSM and VLSM operations.
  • Validation Engine - Deep dive into the O(N log N) Line-Sweep overlap detection engine.
  • 🏗️ Architecture - Understand the strict separation of concerns and netpulse implicit namespace.
  • 🧪 Testing - Learn how to run our comprehensive test suite.

🤝 Contributing

We welcome contributions from the community! netpulse-subnet is open-source and maintained actively.

Please read our Contributing Guidelines to understand how to clone the repository, use uv for dependency management, and submit your Pull Requests.

If you've found a bug or have a feature request, feel free to open an issue!

📜 License

Distributed under the MIT License. See LICENSE for more information.

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

netpulse_subnet-0.1.4.tar.gz (653.0 kB view details)

Uploaded Source

Built Distribution

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

netpulse_subnet-0.1.4-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file netpulse_subnet-0.1.4.tar.gz.

File metadata

  • Download URL: netpulse_subnet-0.1.4.tar.gz
  • Upload date:
  • Size: 653.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for netpulse_subnet-0.1.4.tar.gz
Algorithm Hash digest
SHA256 2f526b681aef71b17eff9274a752c59c5ae53ed95f82046cf8923da3af0e6e67
MD5 6a713b571f7c57cb2c90bae729a3b9f3
BLAKE2b-256 1f1b158b5111d8b0e08bc4e639f9f4fddb357d6c8cd8259e95ac16be98773d2a

See more details on using hashes here.

File details

Details for the file netpulse_subnet-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: netpulse_subnet-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for netpulse_subnet-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3f1d9300e7727bf69978fdff06addb884ac4b338329a87314ee0f3f5088803d0
MD5 ec5e694ce751f1205bc60a9a9750d8b8
BLAKE2b-256 b950f78be7f36db3924524687f055e2b290fb91a7805de37e3487b7846fba71a

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