Skip to main content

Subnetting and network discovery tool

Project description

NetPulse Subnet Logo

NetPulse Subnet

High-performance, standalone Python library & CLI for IPv4 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 address spaces natively in Python or directly from the terminal.

✨ Features

  • 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.
  • 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"

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

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

# Plan VLSM allocation
result = allocate_vlsm("192.168.1.0/24", [{"name": "HR", "hosts": 120}])
print(f"Allocated block: {result.allocations[0].network_cidr}")

📖 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.
  • 🏗️ 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.3.tar.gz (638.2 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.3-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: netpulse_subnet-0.1.3.tar.gz
  • Upload date:
  • Size: 638.2 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.3.tar.gz
Algorithm Hash digest
SHA256 3f5510b14539c4b76f14ef5442638062708a62838959758f550d46f6971b4471
MD5 2a4231db1ff075fd57ef2d345a65ed89
BLAKE2b-256 4b57e4374a42c27df8323503b21dcfd08766386c7ba4b88dad4b1223dc4ec5a7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: netpulse_subnet-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 13.7 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ebdcda48aa465faad65d0f0da76983cf6ab13f77cf3c08acf113447e9e40331f
MD5 65b383d362ba41c2b93247b587ef8db3
BLAKE2b-256 750f9da800fe9112368c3f180b838a0cf2e8f98e9a15aaa1073997cf03467015

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