Skip to main content

Prettify and enrich ifconfig output: aligned tables, IP/MAC/scope annotations, OUI vendor lookup, live DNS/DHCP/route, and a 1h bandwidth graph.

Project description

ifpretty

Prettify and enrich ifconfig output — aligned tables, color, decoded flags, IP/MAC/scope annotations, OUI vendor lookup, live DNS/DHCP/route, and a 1‑hour bandwidth graph. Built on rich; macOS‑focused.

ifconfig | ifpretty

Install

pip install ifpretty

Usage

ifpretty                       # essentials view; runs `ifconfig` for you
ifpretty -v                    # verbose: every field + expand collapsed interfaces
ifpretty en0                   # limit to one or more interfaces
ifconfig | ifpretty            # or pipe ifconfig in yourself
ifconfig | ifpretty --records  # compact label/value record layout
ifconfig | ifpretty --table    # single wide table, all fields as columns (<=240)
ifconfig | ifpretty --live      # + route, traffic, friendly names, DNS, DHCP (macOS)
ifconfig | ifpretty --check     # + ping the default gateway for latency (macOS)
ifconfig | ifpretty --wan       # + public IP / ASN / geo (opt-in; sends IP to ipapi.co)
ifpretty --diff                 # show what changed since the previous run
ifconfig | ifpretty --explain   # append a legend explaining the flags/options seen
ifpretty --update-oui           # refresh the bundled IEEE vendor database

Run it bare and it runs ifconfig for you; or pipe ifconfig in to control which interfaces to show. The default is an essentials view (identity, routable IPs, gateway, throughput) that collapses down/address-less interfaces to one line; pass -v for every field.

What it adds

Always on (offline, deterministic):

  • Per‑interface role (loopback / Ethernet·Wi‑Fi / VPN·tunnel / bridge / …).
  • IP scope for every address — loopback / link‑local / ULA / private / global — plus IPv4 network + usable‑host count.
  • MAC kind (universal vs locally‑administered), OUI vendor (bundled IEEE registry, no network), shared‑MAC notes (e.g. bridge members), and EUI‑64 detection.
  • Media speed/duplex with a half‑duplex ⚠ warning; jumbo / sub‑1280 MTU notes.
  • Decoded flag/option/nd6 bitfields; aligned IPv6 attribute columns.

--live (macOS, cross‑references the system):

  • Default route + gateway, friendly hardware‑port names, per‑interface DNS and search domains, DHCP server + lease, traffic counters (bytes + packets) and error/collision counts.

--check: pings the default gateway and reports latency.

--wan (external, opt‑in): looks up your public IP plus ASN/ISP/geo via ipapi.co and shows it in the overview. This sends your public IP to a third party, so it is strictly opt‑in; the result is cached for ~1 h, times out fast, and degrades silently offline. --update-oui refreshes the vendor database from the IEEE registry into ~/.cache/ifpretty/ (overrides the bundled copy).

--diff: every run records a snapshot of the stable interface state (up/down, addresses, MAC, mtu, media, gateway — not volatile counters) to ~/.cache/ifpretty/snapshot.json. With --diff, ifpretty prints what changed since the previous run — interfaces added/removed, status flips, and added/removed IPv4/IPv6 addresses — before the normal view.

1‑hour bandwidth graph: schedule the recorder, then a Unicode sparkline of the last hour appears automatically:

# once, e.g. in crontab -e
* * * * * /usr/local/bin/ifpretty --record
1h in  ▁▁▁▂▄█▅▂▁▁▁▁   peak 10.0 Mbps
1h out ▁▂▂▄▆█▄▂▂▁▁▁   peak 533.3 Kbps

History is stored at ~/.cache/ifpretty/samples.csv (override with IFPRETTY_HISTORY).

Notes

  • Colors auto‑disable when piped; force with CLICOLOR_FORCE=1, disable with NO_COLOR=1.
  • --live / --check / --record use macOS tools (route, netstat, networksetup, scutil, ipconfig, ping) and no‑op elsewhere.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ifpretty-0.7.0.tar.gz (416.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ifpretty-0.7.0-py3-none-any.whl (406.7 kB view details)

Uploaded Python 3

File details

Details for the file ifpretty-0.7.0.tar.gz.

File metadata

  • Download URL: ifpretty-0.7.0.tar.gz
  • Upload date:
  • Size: 416.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for ifpretty-0.7.0.tar.gz
Algorithm Hash digest
SHA256 7eafbcfba7d34354248a12bc55e39720fcce922fda00df1c4428f2f755879ba7
MD5 679b7acda245a1512e7433780f41db10
BLAKE2b-256 8b3e92196ac7df8227d0510f1b1a5255c560927ad97563d0fa5deae89e857525

See more details on using hashes here.

File details

Details for the file ifpretty-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: ifpretty-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 406.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for ifpretty-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 882437fc21613717ac6368c57339027612d970702f2a13dcedc02e7ff596a16d
MD5 62c1583df8b4c883d16af0299742434a
BLAKE2b-256 e57a449b505c1b42460c4202fa5bea51af162e65a5e7118e5d79e6fac4550f5c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page