IPy

0.75 BSD License    
2.3/5 20

description

specifications

changelog

IPy is a Python class and tools for handling of IPv4 and IPv6 addresses and networks. The script is similar to the Net::IP Perl module.

The IP class allows a comfortable parsing and handling for most notations in use for IPv4 and IPv6 Addresses and Networks. It was greatly inspired bei RIPE's Perl module NET::IP's interface but doesn't share the Implementation. It doesn't share non-CIDR netmasks, so funky stuff lixe a netmask 0xffffff0f can't be done here.

>>> from IPy import IP
>>> ip = IP('127.0.0.0/30')
>>> for x in ip:
... print x
...
127.0.0.0
127.0.0.1
127.0.0.2
127.0.0.3
>>> ip2 = IP('0x7f000000/30')
>>> ip == ip2
1
>>> ip.reverseNames()
['0.0.0.127.in-addr.arpa.', '1.0.0.127.in-addr.arpa.',
'2.0.0.127.in-addr.arpa.', '3.0.0.127.in-addr.arpa.']
>>> ip.reverseName()
'0-3.0.0.127.in-addr.arpa.'
>>> ip.iptype()
'PRIVATE'
read more   
Last updated on April 12th, 2011

0 User reviews so far.

SUBMIT
A Python class and tools for handling of IPv4 and IPv6 addresses and networks

  756 downloads

#Python class #IPv4 handling #IPv6 handling #Python #class #IPv4 #IPv6