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.6.0.tar.gz (415.6 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.6.0-py3-none-any.whl (404.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ifpretty-0.6.0.tar.gz
Algorithm Hash digest
SHA256 8761c056aa4c0edf56b88e7cab4e5dcf00f36d90abd5423cb40096b8d5bebd19
MD5 eec0ad0040412ec42a117a1731bbb92e
BLAKE2b-256 284e8d4ada85af2dab58efd5f32cfd61e6a4914154016eb793a9da4d91c2669a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ifpretty-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 404.9 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.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16c3eb17d163e5c2353ea1d9bde441fb3b21b56e42c463eb3177a5dd35190ba7
MD5 b122fcbac7c84650cc395f2d371252d2
BLAKE2b-256 bf309d6f9ec9db102dad32b67f24c29adfc603ec52c1b3c9a3894b890eb74d6b

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