Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Backport of Python 3's ipaddress module

Project Description

backport_collections is a backport of Python 3’s ipaddress module for Python 2.6 and Python 2.7. It is based on the backport of Søren Løvborg (

What is backported?

The ipaddress module.


To use it just import the module ipaddress as you would in Python 3. Example:

import ipaddress


Given that there is no real bytes types in Python 2, we are using bytearray, which is a mutable version of bytes and in Python 2, has fewer methods.

So if in Python 3 you would do:


with this port you need to do:



One thing that is missing and could be important for performance is the lru_cache for many of the methods. functools in Python 2 does not have such decorator. Maybe in the future I will backport that method as well.


The Python Software Foundation License.


Release History

Release History

This version
History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
backport_ipaddress-0.1.tar.gz (31.6 kB) Copy SHA256 Checksum SHA256 Source Sep 1, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting