This module allows you to perform IP subnet calculations, there is support for both IPv4 and IPv6 CIDR notation. WWW: https://pypi.python.org/pypi/ipcalc/