--- id: netifaces2 version: "0.0.22" license: unclear license_treatment: permissive maintenance: abandoned --- # netifaces2 — Portable network interface information License: permissive · Maintenance: abandoned · Downloads: 235.6K/mo ## What it is and what it does netifaces2 is a rewrite of the abandoned original netifaces library, providing a way to query network interface information (IP addresses, gateways, interface names) in Python across Linux, macOS, and Windows. It aims to be a drop-in replacement with the same API, but adds type annotations and support for current Python versions. The package wraps system calls via Rust bindings to retrieve network configuration data. The library exposes functions like interfaces(), ifaddresses(), gateways(), and default_gateway() to enumerate network adapters and retrieve their addresses and routing information. However, the gateways API has known limitations: it requires /proc/net/route or the ip tool on Linux and is non-functional on Windows. The AF_ constants now reflect platform-native values rather than being abstracted, which may require code changes when migrating from the original netifaces. Use it for: - Enumerate all network interfaces and their IP addresses on a system for inventory or diagnostic tools. - Retrieve the default gateway for network routing decisions in cross-platform applications. - Query interface-specific address information (IPv4, IPv6, MAC) for network configuration scripts. - Build system monitoring tools that need to detect network adapter changes or status. - Develop network-aware applications that must discover local interface details at runtime. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Retrieves network interface information (addresses, gateways, interface names) across Linux, macOS, and Windows with type annotations and a modernized API. No. The repository is archived and abandoned as of 2024-09-04 with no active maintenance. While the 0.0.22 release is stable and has no known vulnerabilities, the lack of ongoing support, known API gaps (non-functional Windows gateways, incomplete address families), and medium install friction make it unsuitable for new projects. Consider only if you are maintaining legacy code already using netifaces2 and need Python 3.6+ support. ## Install pip install netifaces2 uv add netifaces2 poetry add netifaces2 ## Installing netifaces2 Before you install: Medium install friction due to compiled Rust components requiring a build step. Repository is archived and unmaintained as of 2024-09-04, with no active development; use only if the frozen 0.0.22 release meets your needs. License in practice: MIT license (permissive) allows commercial and private use with minimal restrictions; no copyleft obligations. Quickstart: pip install netifaces2 import netifaces print(netifaces.interfaces()) print(netifaces.ifaddresses('en0')) print(netifaces.default_gateway()) Requires Rust toolchain (rustup) for local development builds; gateways API requires /proc/net/route or the ip tool on Linux and is non-functional on Windows. Verify before relying: - Whether the frozen 0.0.22 release is compatible with Python versions beyond 3.6 despite the abi3 wheels suggesting broader support. - Whether address families and PEER addresses mentioned as incomplete in the description have been addressed in 0.0.22. - Real-world compatibility with PyPy given the Rust implementation. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: medium - Maintenance: abandoned - Downloads: 235.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags network interface addresses, get local ip addresses, network gateway information, cross-platform network info, interface enumeration, network configuration query, system network details, network-interfaces, system-info, cross-platform [View on SkillFed](https://skillfed.io/packages/netifaces2) · [View on PyPI](https://pypi.org/project/netifaces2/)