python package ipaddr 2.1.10 fails two of the IP tests
2 of 494 tests failed: "02001:0000:1234:0000:0000:C1C0:ABCD:0876" match should be False - not OK "2001:0000:1234:0000:00001:C1C0:ABCD:0876" match should be False - not OK
This is the ipaddr that is part of debian wheezy. Given it is in a stable, and has a low error rate, it could be considered acceptable.
However, 2.1.6-2.1.9 fail 17 additional tests
"02001:0000:1234:0000:0000:C1C0:ABCD:0876" match should be False - not OK "2001:0000:1234:0000:00001:C1C0:ABCD:0876" match should be False - not OK " 2001:0000:1234:0000:0000:C1C0:ABCD:0876" match should be False - not OK "2001:0000:1234:0000:0000:C1C0:ABCD:0876 " match should be False - not OK " 2001:0000:1234:0000:0000:C1C0:ABCD:0876 " match should be False - not OK "2001:0000:1234: 0000:0000:C1C0:ABCD:0876" match should be False - not OK "fe80:0000:0000:0000:0204:61ff:254.157.241.086" match should be False - not OK "1:2:3::4:5:6:7:8:9" match should be False - not OK "1111:2222:3333:4444:5555:6666:7777:8888::" match should be False - not OK "::2222:3333:4444:5555:6666:7777:8888:9999" match should be False - not OK "1111:2222:3333:4444:5555:6666:7777:8888:1.2.3.4" match should be False - not OK "1111:2222:3333:4444:5555:6666:7777:1.2.3.4" match should be False - not OK "1111:2222:3333:4444:5555:6666::1.2.3.4" match should be False - not OK "::2222:3333:4444:5555:6666:7777:1.2.3.4" match should be False - not OK "1111:2222:3333:4444:5555:1.2.3.4" match should be False - not OK "1111:2222:3333:4444:1.2.3.4" match should be False - not OK "1111:2222:3333:1.2.3.4" match should be False - not OK "1111:2222:1.2.3.4" match should be False - not OK "1111:1.2.3.4" match should be False - not OK
Unfortunately 2.1.5 is the debian squeeze version, and it is not easily installed via pip.
fwiw, ipaddr 1.x doesnt include an IPAddress function.