skillfed

iptools

Python utilites for manipulating IPv4 and IPv6 addresses

iptools v0.7.0 237.2K downloads/30d#8,962 on PyPI70
Permissive license BSD Abandoned released

What it is and what it does

iptools is a lightweight utility library for working with IP addresses in Python. It provides functions and objects to parse, validate, and test membership of IPv4 and IPv6 addresses, with special support for CIDR notation and arbitrary ranges. The package was originally designed to simplify Django's INTERNAL_IPS configuration by allowing developers to specify IP ranges using CIDR blocks instead of listing individual addresses.

The core feature is the IpRangeList object, which implements Python's membership protocol (the `in` operator) to transparently handle mixed lists of single IPs, CIDR blocks, and start-end ranges. This makes it useful anywhere you need to check whether an IP falls within a set of allowed or blocked ranges. However, the package has been abandoned since 2019 and receives no maintenance, so it will not be updated for new Python versions or security issues.

Use it for:

  • Configure Django's INTERNAL_IPS setting with CIDR blocks instead of individual IP addresses
  • Check whether a client IP is within a set of allowed or blocked network ranges in a web application
  • Parse and validate IPv4 and IPv6 addresses in network configuration or logging tools
  • Convert between IP address formats and numeric representations for network calculations

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides utilities for parsing, validating, and manipulating IPv4 and IPv6 addresses, including CIDR notation and range operations.

Yes, if you need basic IP address utilities and are working with Python versions up to 3.8. The package is stable and has no known vulnerabilities, but its abandonment means no future fixes. Suitable for legacy projects or simple use cases; for new projects requiring active maintenance, consider alternatives like ipaddress (built-in to Python 3.3+) or netaddr.

Install

iptools on PyPI

pip

pip install iptools

uv

uv add iptools

poetry

poetry add iptools

Installing iptools

Before you install

Low install friction with no runtime dependencies. However, the package is abandoned—last release was 2019-01-07 and last commit 2020-01-22—so it will not receive bug fixes or security updates.

License in practice

BSD license is permissive, allowing commercial and private use with minimal restrictions, making it safe to incorporate into most projects.

Quickstart

pip install iptools

import iptools

ranges = iptools.IpRangeList(
    '127.0.0.1',
    '192.168/16',
    ('10.0.0.1', '10.0.0.19')
)

if '192.168.1.1' in ranges:
    print('IP is in range')

Verify before relying

  • Whether the package works correctly with modern Python versions beyond 3.8, given it was last updated in 2019
  • Whether IPv6 handling is complete and correct for all edge cases
  • Performance characteristics when dealing with large numbers of IP ranges

Package facts

License BSD (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 2,776 days since the last release
Last repo commit
First released
Downloads 237,201/month — #8,962 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: iptools-0.7.0-py2.py3-none-any.whl

Keywords: ip2long, long2ip, django, cidr, ipv4, ipv6

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Topic :: InternetTopic :: Utilities

Tags

ipv4 ipv6 address utilitiescidr notation parsingip range validationdjango internal ipsip address manipulationip range membership testingconvert ip to long
networkingcidrdjango

More Internet packages