Human-friendly names and metadata for Linux network interfaces
Project description
iffriendly
A Python library for providing human-friendly names and rich metadata for network interfaces on Linux systems.
Features
- Discover all network interfaces on a Linux system
- Get rich metadata for each interface:
- System name (e.g.,
eth0,wlan0) - Device path
- MAC address and manufacturer
- IP addresses
- Connection method (PCIe, USB, Platform, etc.)
- Human-friendly name (e.g., "Internal Intel WiFi", "USB Ethernet Adapter")
- System name (e.g.,
- Extensible metadata enrichment system
- Integration-ready output format
Requirements
- Linux operating system
- Python 3.8 or later
- Root access (for some features)
Installation
pip install iffriendly
For development:
pip install iffriendly[dev]
Usage
Basic usage:
from iffriendly.interface import get_interface_list
# Get all interfaces with metadata
interfaces = get_interface_list()
# Print friendly names and connection methods
for name, meta in interfaces.items():
print(f"{name}: {meta.friendly_name} ({meta.connection_method})")
Adding custom metadata:
from iffriendly.interface import register_enricher, get_interface_list
# Register a custom metadata enricher
def add_custom_field(system_name, meta):
return {'extra': {**meta.extra, 'custom': 'value'}}
register_enricher(add_custom_field)
# Get enriched interface data
interfaces = get_interface_list()
Development
- Clone the repository:
git clone https://github.com/jem/iffriendly.git
cd iffriendly
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Linux/macOS
- Install development dependencies:
pip install -e ".[dev]"
- Run tests:
pytest
License
Apache License 2.0. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
iffriendly-0.1.1.tar.gz
(16.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iffriendly-0.1.1.tar.gz.
File metadata
- Download URL: iffriendly-0.1.1.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a90f076c391faf3b979b81400fb1c761cd09fe2b0f82e512a61e051d57f79ae
|
|
| MD5 |
7edd0d99351f4028eeb231da1b0f1de8
|
|
| BLAKE2b-256 |
f1a138a5229c56fd210e9eed6491e635953a12cec7cdc4426846a22184bed328
|
File details
Details for the file iffriendly-0.1.1-py3-none-any.whl.
File metadata
- Download URL: iffriendly-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
701ec8ee4fe828426e6d55fec74c339af1b7c3347d5108c795cad05e223b2c7a
|
|
| MD5 |
d2a06cd87ece3ca7282a48107877d136
|
|
| BLAKE2b-256 |
f683f5e24255a1819dc2de4061a35056c391958e99f2239ebf6f37b5ae7cf7ee
|