iptools
Python utilites for manipulating IPv4 and IPv6 addresses
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 iptoolsuv
uv add iptoolspoetry
poetry add iptoolsInstalling 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
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
ipaddrProvides utilities for parsing, validating, and…
permissive · top 15,000 on PyPI
cidr-trieStores and queries CIDR IP address blocks (IPv4…
permissive · top 15,000 on PyPI
IPyIPy provides Python classes for parsing,…
permissive · top 5,000 on PyPI
netaddrRepresents and manipulates IPv4, IPv6, MAC…
permissive · top 5,000 on PyPI
isc-dhcp-leasesReads and parses ISC DHCP server lease files…
permissive · top 15,000 on PyPI
django-allow-cidrA Django middleware that extends ALLOWED_HOSTS…
permissive · top 5,000 on PyPI
jaraco.netjaraco.net provides miscellaneous networking…
permissive · top 15,000 on PyPI
ipaddressProvides IPv4 and IPv6 address manipulation for…
permissive · top 5,000 on PyPI
IP2LocationLooks up geolocation data (country, region,…
permissive · top 15,000 on PyPI
py-radixImplements a radix tree data structure for…
permissive · top 15,000 on PyPI