Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Utilities

    iptools 0.6.1

    Download button

    No screenshots available
    Downloads: 648  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Bryan Davis | More programs
    BSD License / FREE
    May 18th, 2010, 08:49 GMT
    ROOT / Utilities

     Read user reviews (0)  Refer to a friend  Subscribe

    iptools description

    Python utilites for manipulating IP addresses

    The iptools package contains a few useful functions and objects for manipulating ip addresses in Python. This was all inspired by a desire to be able to use CIDR address notation to designate INTERNAL_IPS in a Django project's settings file.

    Functions:

     * validate_ip: Validate a dotted quad ip address.
     * ip2long: Convert a dotted quad ip address to a network byte order 32-bit integer.
     * long2ip: Convert a network byte order 32-bit integer to a dotted quad ip address.
     * validate_cidr: Validate a CIDR notation ip address.
     * cidr2block: Convert a CIDR notation ip address into a tuple containing network block start and end addresses.

    Objects:

     * IpRange: Range of ip addresses providing `in` and iteration.
     * IpRangeList: List of IpRange objects providing `in` and iteration.

    Using with Django

    The IpRangeList object can be used in a django settings file to allow CIDR notation and/or (start, end) ranges to be used in the INTERNAL_IPS list.

    Example:

    #!/usr/bin/env python
    import iptools

    INTERNAL_IPS = iptools.IpRangeList(
     '127.0.0.1', # single ip
     '192.168/16', # CIDR network block
     ('10.0.0.1', '10.0.0.19'), # inclusive range
    )


    Python Version Compatibility

    This library has been tested with Python versions 2.3.5, 2.6.2, & 2.3.1 on Ubuntu x86_64 and Python 2.6.1 & 2.6.4 on Snow Leopard.

    Installing

    Install the latest stable version using easy_install:

    easy_install iptools

    or pip:

    pip install iptools

    Install the latest development version:

    svn checkout http://python-iptools.googlecode.com/svn/trunk/ python-iptools
    cd python-iptools
    python setup.py install



    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    IP handler | IP manager | IP address | IP | handler | manipulator

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM