skillfed

ifaddr

Cross-platform network interface and IP address enumeration library

ifaddr v0.2.0 6.8M downloads/30d#1,857 on PyPI91
Permissive license MIT Active released

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 ifaddr

uv

uv add ifaddr

poetry

poetry add ifaddr

Installing 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

Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: System :: Networking

Tags

network interface enumerationget local IP addresseslist network adapterscross-platform network infoethernet adapter discoveryIPv4 IPv6 addressesnetwork interface query
network-discoverycross-platformzero-deps

More Networking packages