ifaddr
Cross-platform network interface and IP address enumeration library
What it is and what it does
ifaddr is a lightweight Python library that discovers all network interfaces and their assigned IP addresses on your system. It works cross-platform on Linux, macOS, Windows, and BSD variants without needing to compile anything—just install and import. The library returns both IPv4 and IPv6 addresses with their network prefixes, and can optionally include unconfigured interfaces with no IPs assigned.
You call `get_adapters()` to retrieve a list of network adapters, then iterate through each adapter's `ips` property to access individual addresses. It provides human-readable adapter names and interface indexes, making it useful for applications that need to discover local network configuration programmatically.
Use it for:
- Discover all local IP addresses for binding a server to the correct interface in multi-homed systems
- Build network diagnostic tools that display available adapters and their configurations
- Automatically detect IPv6 addresses with scope IDs for link-local communication
- Find unconfigured network interfaces for system inventory or monitoring applications
- Replace netifaces for projects that cannot tolerate compilation overhead
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Enumerate network interfaces and their IP addresses across Linux, macOS, Windows, and BSD systems without requiring compilation.
Yes. ifaddr is a focused, well-maintained tool for a specific task—enumerating network interfaces—with zero runtime dependencies, no compilation, and proven cross-platform support. Install it if you need to query local network configuration programmatically. The MIT license carries no restrictions.
Install
ifaddr on PyPI
pip
pip install ifaddruv
uv add ifaddrpoetry
poetry add ifaddrInstalling ifaddr
Before you install
Low friction: pure Python wheel, no compilation needed. Actively maintained with recent commits; last release was 1521 days ago but repo shows ongoing activity.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
import ifaddr
adapters = ifaddr.get_adapters()
for adapter in adapters:
print(f"{adapter.nice_name}: {[ip.ip for ip in adapter.ips]}")
Verify before relying
- Whether the package handles dynamic network changes (hot-plugging interfaces) or requires re-enumeration
- Performance characteristics when enumerating many network interfaces or on systems with hundreds of adapters
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1,521 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,751,617/month — #1,857 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ifaddr-0.2.0-py3-none-any.whl
Keywords: network interfaces, network adapters, network addresses, IP addresses
Tags
More Networking packages
h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
psutilpsutil retrieves real-time information about…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
uvloopuvloop is a drop-in replacement for Python's…
permissive · top 1,000 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
pyzmqPyZMQ provides Python bindings for ZeroMQ…
permissive · top 1,000 on PyPI
netifaces-plusRetrieves network interface information…
permissive · top 15,000 on PyPI
netifacesProvides portable access to network interface…
permissive · top 5,000 on PyPI
netifaces2Retrieves network interface information…
permissive · top 15,000 on PyPI
getmacRetrieves MAC addresses of local network…
permissive · top 15,000 on PyPI
ifcfgIfcfg parses network interface configuration…
permissive · top 15,000 on PyPI
netaddrRepresents and manipulates IPv4, IPv6, MAC…
permissive · top 5,000 on PyPI
ipaddrProvides utilities for parsing, validating, and…
permissive · top 15,000 on PyPI
bluetooth-adaptersEnumerates and locates Bluetooth adapters on a…
permissive · top 15,000 on PyPI
IP2LocationLooks up geolocation data (country, region,…
permissive · top 15,000 on PyPI
mac-aliasmac_alias generates and reads binary Alias and…
permissive · top 15,000 on PyPI