An introduction to the ipaddress module Release 3.9.5 Guido van Rossum and the Python development team June 01, 2021 Python Software Foundation Email: docs@python.org Contents 1 Creating Address/Network/Interface objects 2 1.1 A Note on IP Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 IP Host Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 Defining Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.4 Host Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 Inspecting Address/Network/Interface Objects 4 3 Networks as lists of Addresses 5 4 Comparisons 5 5 Using IP Addresses with other modules 6 6 Getting more detail when instance creation fails 6 Overview This document aims to provide a gentle introduction to the$_{ipaddress}$ module. It is aimed primarily at users that aren’t already familiar with IP networking terminology, but may also be useful to network engineers wanting an overview of how$_{ipaddress}$ represents IP network addressing concepts. 1 author Peter Moody author Nick Coghlan