ipaddress
IPv4/IPv6 manipulation library
What it is and what it does
This package backports Python 3.3+'s ipaddress module to older Python versions (2.6, 2.7, 3.2). It provides classes and functions for creating and manipulating IPv4 and IPv6 addresses, networks, and interfaces—the same API you would use in modern Python's standard library. The main constraint is that it requires unicode strings for address input, not byte strings; passing bytes will raise an error.
The package is production-stable but abandoned; its last release was in 2019. It exists primarily as a compatibility shim for legacy codebases still running on Python 2 or early Python 3. If you are on Python 3.3 or later, use the built-in ipaddress module instead.
Use it for:
- Validate and parse IPv4 or IPv6 addresses in Python 2.7 codebases that cannot yet migrate to Python 3.
- Work with IP networks and subnets in legacy applications.
- Check if an IP address belongs to a given network range on older Python versions.
- Normalize and manipulate IP address objects with a consistent API across Python 2 and 3.2.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides IPv4 and IPv6 address manipulation for Python 2.6, 2.7, and 3.2—backporting the standard library ipaddress module from Python 3.3+.
No, unless you are maintaining legacy Python 2.6, 2.7, or 3.2 code that requires ipaddress. The package is abandoned and modern Python includes ipaddress in the standard library. If you are on Python 3.3+, use the standard library instead. If you must support Python 2, this is the only option, but consider upgrading your runtime.
Install
ipaddress on PyPI
pip
pip install ipaddressuv
uv add ipaddresspoetry
poetry add ipaddressInstalling ipaddress
Before you install
Install friction is low. However, the package is abandoned—last release was 2019-10-18, with no commits since 2020-11-20. Only install if you are stuck on Python 2.6, 2.7, or 3.2; modern Python versions include ipaddress in the standard library.
License in practice
Licensed under the Python Software Foundation License (permissive). No restrictions on use, modification, or distribution in most contexts.
Quickstart
pip install ipaddress==1.0.23
import ipaddress
addr = ipaddress.ip_address(u'1.2.3.4')
net = ipaddress.ip_network(u'10.0.0.0/8')
Must pass unicode strings (u'...') or use `from __future__ import unicode_literals`; byte strings will raise AddressValueError. Only needed for Python 2.6, 2.7, or 3.2.
Verify before relying
- Whether the backport tracks all fixes and features from the current CPython ipaddress module, or only up to version 3.8 as mentioned in the description.
- Full extent of API coverage compared to modern standard library ipaddress.
Package facts
| License | Python Software Foundation License (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,492 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,142,720/month — #1,964 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ipaddress-1.0.23-py2.py3-none-any.whl
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
netaddrRepresents and manipulates IPv4, IPv6, MAC…
permissive · top 5,000 on PyPI
IPyIPy provides Python classes for parsing,…
permissive · top 5,000 on PyPI
isc-dhcp-leasesReads and parses ISC DHCP server lease files…
permissive · top 15,000 on PyPI
iptoolsProvides utilities for parsing, validating, and…
permissive · top 15,000 on PyPI
python-hostsManages hosts file entries…
permissive · top 15,000 on PyPI
backports.ssl_match_hostnameProvides the ssl.match_hostname() function for…
permissive · top 15,000 on PyPI
multiaddrParses, constructs, and manipulates…
permissive · top 15,000 on PyPI
django-netfieldsProvides Django model fields for PostgreSQL…
permissive · top 15,000 on PyPI
IP2LocationLooks up geolocation data (country, region,…
permissive · top 15,000 on PyPI