Registry / http-networking / netifaces-plus

netifaces-plus

JSON →
library0.12.5pypypi✓ verified 34d ago

A portable library to retrieve network interface information (IP addresses, MAC addresses, gateways, etc.) on Unix, Windows, and macOS. Version 0.12.5 supports Python >=3.6. Fork of the unmaintained netifaces with modern Python support and additional features. Released irregularly.

http-networkingdevops
Install & Compatibility
Where this runs
tested against v0.12.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

The library name in PyPI is 'netifaces-plus' but the import package is 'netifaces'. Do not use the hyphenated name.

import netifaces

The function to list interface names is `interfaces()`, not `networks()`.

netifaces.interfaces()

`gateways()` is a top-level function returning all gateway info. There is no `default_gateway()`.

netifaces.gateways()

Basic usage: list interfaces, get addresses for first interface, and show gateways.

import netifaces # List all network interface names ifaces = netifaces.interfaces() print('Interfaces:', ifaces) # Get addresses for a specific interface (e.g., 'eth0' or 'en0') if ifaces: iface = ifaces[0] addrs = netifaces.ifaddresses(iface) print(f'Addresses for {iface}:', addrs) # Get default gateways print('Gateways:', netifaces.gateways())
Debug
Known footguns
gotchaThe PyPI package name is 'netifaces-plus' but the Python import is 'netifaces'. This often confuses users who try 'import netifaces_plus'.
gotchaOn some platforms (e.g., Windows), 'ifaddresses(MY_IFACE)' may return empty or partial data if the interface is down or not fully initialized. Always handle missing keys.
breakingIn version 0.12.4, the library dropped support for Python 3.5 and below. Users on older Python must pin to an older release.
gotchaThe 'gateways()' function returns a dict where keys are address families (e.g., AF_INET, AF_INET6) and values are lists. The default gateway is the first element of the list, not a separate key.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
10 hits · last 30 days
gptbot
4
ahrefsbot
3
claudebot
2
script
1
Resources