IPy Description
The IP class allows for easy parsing and handling of most notations used for IPv4 or IPv6 addresses and network. Although it was inspired by RIPE’s Perl module NET.IP's interface, it doesn't share its implementation. It doesn't share non CIDR netmasks so it can't do crazy stuff like a netmask 0xffffff0f. It can recognize about a dozen ways to express IP addresses and networks, and parse them to distinguish between IPv4 addresses and IPv6 addresses. Nearly all class methods that return a string include an optional parameter called "wantprefixlen", which controls whether the prefixlen and netmask are printed. If the network has more than one address, the prefilen will always be shown. You can also alter the defaults per-object by manipulating the class members.