skillfed

ifcfg

Python ifconfig wrapper for Unix/Linux/MacOSX + ipconfig for Windows

ifcfg v0.24 151.1K downloads/30d#10,945 on PyPI61
Permissive license BSD DORMANT released

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 ifcfg

uv

uv add ifcfg

poetry

poetry add ifcfg

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: PyPy

Tags

network interface discoveryparse ifconfig outputget local ip addressnetwork interface informationcross-platform network configsystem network interfacesinterface metadata extraction
network-discoverycross-platformsystem-utilities

More Networking packages