netaddr
A network address manipulation library for Python
What it is and what it does
netaddr is a pure-Python library for parsing, representing, and manipulating network addresses at Layer 2 and Layer 3. It handles IPv4 and IPv6 addresses, subnets, and masks; MAC and EUI-64 identifiers; and provides utilities like CIDR parsing, IANA block lookups, and DNS reverse-lookup generation. The library has no runtime dependencies and installs cleanly on Python 3.7 and later.
Typical use is in network automation, infrastructure tooling, and systems administration where you need to work with IP ranges, validate addresses, perform subnet calculations, or look up organizational information tied to IP blocks or MAC vendors. It supports set-based operations (unions, intersections) over address ranges and can parse multiple formats including CIDR, arbitrary ranges, and nmap notation.
Use it for:
- Validate and parse user-supplied IP addresses or CIDR blocks in network configuration tools.
- Iterate over all hosts in a subnet or check membership of an IP in a range.
- Perform supernetting or subnetting calculations for network planning.
- Look up IANA IP block ownership or IEEE OUI/IAB information for network diagnostics.
- Generate DNS reverse-lookup zones from IP ranges in DNS management scripts.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Represents and manipulates IPv4, IPv6, MAC addresses and related network objects; supports CIDR notation, subnetting, set operations, IANA lookups, and DNS reverse generation.
Yes. netaddr is a stable, dependency-free library for a well-defined problem (network address manipulation) with no known vulnerabilities. Its dormant maintenance is not a blocker for stable use cases; the API is mature and the task domain is not rapidly evolving. Install if you need to work with IP addresses, subnets, or MAC addresses in Python.
Install
netaddr on PyPI
pip
pip install netaddruv
uv add netaddrpoetry
poetry add netaddrInstalling netaddr
Before you install
Low friction install with no runtime dependencies. Dormant maintenance (last commit 2024-07-05, 808 days since release) but marked Production/Stable; suitable for stable, well-defined network tasks rather than rapidly evolving features.
License in practice
BSD License (permissive); you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install netaddr
from netaddr import IPNetwork, IPAddress
net = IPNetwork('10.0.0.0/8')
for ip in net:
print(ip)
Requires Python 3.7 or later.
Verify before relying
- Whether the 808-day gap since last release reflects intentional stability or abandonment risk for future Python versions.
- Performance characteristics for large-scale IP range operations or set operations on many subnets.
- Real-world usage patterns and whether the library remains actively maintained despite dormant status.
Package facts
| License | BSD License (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 808 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 13,958,594/month — #1,256 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: netaddr-1.3.0-py3-none-any.whl
Keywords: Networking, Systems Administration, IANA, IEEE, CIDR, IP, IPv4, IPv6, CIDR, EUI, MAC, MAC-48, EUI-48, EUI-64
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
ciscoconfparseParses and queries Cisco IOS-style network…
copyleft · top 15,000 on PyPI
django-netfieldsProvides Django model fields for PostgreSQL…
permissive · top 15,000 on PyPI
infoblox-clientClient library for programmatic interaction…
permissive · top 15,000 on PyPI
ipaddrProvides utilities for parsing, validating, and…
permissive · top 15,000 on PyPI
isc-dhcp-leasesReads and parses ISC DHCP server lease files…
permissive · top 15,000 on PyPI
jaraco.netjaraco.net provides miscellaneous networking…
permissive · top 15,000 on PyPI
censysA Python wrapper for Censys APIs that lets you…
permissive · top 15,000 on PyPI
django-allow-cidrA Django middleware that extends ALLOWED_HOSTS…
permissive · top 5,000 on PyPI
cidr-trieStores and queries CIDR IP address blocks (IPv4…
permissive · top 15,000 on PyPI
ipaddressProvides IPv4 and IPv6 address manipulation for…
permissive · top 5,000 on PyPI