This is an additive VLSM feature package designed to integrate with the existing ipcalc.py without modifying or replacing it. The original uploaded calculator is preserved in this bundle as ipcalc_existing.py for reference; keep your repository's existing ipcalc.py as the source of truth.
- IPv4 VLSM allocation; IPv6 VLSM is intentionally not supported in this first release.
- Largest host requirement is allocated first; equal-sized requests preserve input order.
- Conventional LAN accounting reserves network and broadcast addresses (usable hosts = total addresses - 2).
- Rejects invalid host counts, duplicate subnet names, unsupported IPv6 parents, and insufficient address space.
- Shared calculation engine powers CLI, optional Tkinter desktop UI, and optional FastAPI HTTP API.
- No third-party dependency is required for the calculation engine, CLI, or Tkinter UI.
git switch develop
git pull origin develop
git switch -c feature/vlsm-calculatorCopy the network_toolkit folder, tests folder, and pyproject.toml into the root of your existing project. Do not overwrite ipcalc.py.
From the project root:
python -m unittest discover -s tests -vOr, if using pytest:
python -m pip install -e ".[dev]"
pytest -qpython -m network_toolkit.cli 192.168.10.0/24 --subnet Users 100 --subnet Servers 50 --subnet Voice 20 --subnet Management 10JSON output:
python -m network_toolkit.cli 192.168.10.0/24 --subnet Users 100 --subnet Servers 50 --jsonpython -m network_toolkit.guiTkinter is included with most standard Windows Python installations. If your Python distribution does not include it, install/repair Python with the Tcl/Tk option enabled.
python -m pip install -e ".[api]"
uvicorn network_toolkit.api:app --reloadOpen http://127.0.0.1:8000/docs for interactive API documentation. Example request:
{
"parent": "192.168.10.0/24",
"subnets": [
{"name": "Users", "hosts": 100},
{"name": "Servers", "hosts": 50},
{"name": "Voice", "hosts": 20}
]
}The extension is deliberately isolated so the existing calculator keeps working. After tests pass:
git add network_toolkit tests pyproject.toml README.md
git commit -m "Add VLSM calculator module with CLI GUI and API"
git push -u origin feature/vlsm-calculatorOpen a Pull Request on GitHub: feature/vlsm-calculator → develop. Merge only after reviewing the diff and confirming the existing ipcalc.py behavior remains unchanged.
- Add integration tests for the existing
ipcalc.pycommand-line behavior. - Add optional VLSM reservation modes for point-to-point
/31links. - Add CSV/XLSX export and persistent project plans.
- Add web frontend separately; this package currently exposes the backend REST API, not a browser UI.