ictdesigntools.network.subnet¶
Subnet calculations for IPv4 and IPv6, built on the stdlib ipaddress module.
SubnetError ¶
Bases: ValueError
Raised when the input cannot be parsed as an address or network.
parse ¶
parse(query: str) -> Interface
Parse 10.0.0.1/24, 10.0.0.1 255.255.255.0, 2001:db8::/32 and similar.
An address without a prefix is treated as a single host (/32 or /128).
Source code in src/ictdesigntools/network/subnet.py
calculate ¶
calculate(query: str | Interface) -> SubnetResult
Details of an address and its network, from text (see parse) or an interface.