ifcfg
Python ifconfig wrapper for Unix/Linux/MacOSX + ipconfig for Windows
What it is and what it does
Ifcfg is a lightweight cross-platform wrapper around system network configuration commands. It parses the output of ifconfig (Unix/Linux/macOS), ipconfig (Windows), or the ip command (newer Unix systems) and returns structured data about network interfaces—IP addresses (both IPv4 and IPv6), netmasks, MAC addresses, broadcast addresses, MTU, and interface flags. The library handles multiple addresses per interface and provides a simple dictionary-based API to query all interfaces or retrieve the default interface.
The package is useful when you need to programmatically discover local network configuration without external dependencies. It has no runtime dependencies and installs as a pure Python wheel. The main trade-off is that it relies on system commands being present and their output format remaining stable; Windows support is documented as English-only, and the project has been dormant since 2023-04-19.
Use it for:
- Retrieve the local IP address of the default network interface for service discovery or logging.
- Enumerate all network interfaces and their addresses to configure multi-homed applications.
- Detect MAC addresses for hardware identification or network diagnostics.
- Extract netmask and broadcast information for subnet calculations in network tools.
- Build cross-platform network utilities that need to work on Windows, Linux, and macOS without external libraries.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Ifcfg parses network interface configuration from system commands (ifconfig, ipconfig, or ip) across Windows and Unix platforms, extracting IP addresses, netmasks, MAC addresses, and other interface metadata.
Yes, if you need simple cross-platform network interface discovery and can tolerate dormancy. The package is stable, dependency-free, and widely used. Install it for straightforward IP/interface queries; avoid it if you need active maintenance, support for non-English Windows, or cutting-edge Python version guarantees. Check that system commands (ifconfig/ipconfig/ip) are available on your target platforms.
Install
ifcfg on PyPI
pip
pip install ifcfguv
uv add ifcfgpoetry
poetry add ifcfgInstalling ifcfg
Before you install
Installation is straightforward with no runtime dependencies. The package is dormant (last release 2023-04-19, no commits for 1213 days), but marked Production/Stable and has been maintained across multiple Python versions including 3.10 and 3.11.
License in practice
BSD License (permissive) allows commercial and private use with minimal restrictions—include a copy of the license and attribute the original authors.
Quickstart
import ifcfg
for name, interface in ifcfg.interfaces().items():
print(f"{name}: {interface['inet']}")
default = ifcfg.default_interface()
Requires ifconfig, ipconfig, or ip command available on the system; Windows support is English-only.
Verify before relying
- Whether non-English Windows systems are now supported (release notes indicate known issues with localization).
- Current test coverage and whether the package works reliably on modern Python 3.10+ given the long dormancy.
- Actual usage scale and reliability in production environments.
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 1,213 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 151,081/month — #10,945 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ifcfg-0.24-py2.py3-none-any.whl
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
IPyIPy provides Python classes for parsing,…
permissive · top 5,000 on PyPI
ifaddrEnumerate network interfaces and their IP…
permissive · top 5,000 on PyPI
getmacRetrieves MAC addresses of local network…
permissive · top 15,000 on PyPI
ipaddrProvides utilities for parsing, validating, and…
permissive · top 15,000 on PyPI
netaddrRepresents and manipulates IPv4, IPv6, MAC…
permissive · top 5,000 on PyPI
whichcraftProvides a cross-platform, cross-Python…
permissive · top 15,000 on PyPI
ipwhoisRetrieves and parses whois and RDAP data for…
permissive · top 15,000 on PyPI
zeroconfDiscovers and registers services on local…
copyleft · top 5,000 on PyPI