Victor Stinner edited this page Jan 5, 2015 · 10 revisions

IPy

IPy are a Python class and tools for handling of IPv4 and IPv6 addresses and networks. It is similar to 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'

Get full documentation in source code: README.

Download

This Python module is under BSD license: see COPYING file.

Source code

For the development version of IPy, see the git repository.

Contact

IPy's maintainer is Jeff Ferland.

News

  • 2013-03-19: Release of IPy 0.76
  • 2011-04-12: Release of IPy 0.75
  • 2011-02-16: Release of IPy 0.74
  • 2011-02-15: Release of IPy 0.73
  • 2010-11-23: Release of IPy 0.72
  • 2010-10-01: Release of IPy 0.71
  • 2009-10-29: Release of IPy 0.70
  • 2009-08-19: Release of IPy 0.64
  • 2009-06-23: Release of IPy 0.63
  • 2008-07-15: Release of IPy 0.62

See also

Similar libraries:

  • iplib: distributed under GNU GPL license
  • ipaddr-py: Apache License 2.0
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.