Metadata-Version: 2.4
Name: ifpretty
Version: 0.3.0
Summary: Prettify and enrich ifconfig output: aligned tables, IP/MAC/scope annotations, OUI vendor lookup, live DNS/DHCP/route, and a 1h bandwidth graph.
Author-email: iklo <tiktachack@gmail.com>
License: MIT
Keywords: ifconfig,network,networking,cli,terminal,rich,macos
Classifier: Environment :: Console
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: System :: Networking
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: rich>=13
Dynamic: license-file

# 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](https://github.com/Textualize/rich); macOS‑focused.

```
ifconfig | ifpretty
```

## Install

```sh
pip install ifpretty
```

## Usage

```sh
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 --explain   # append a legend explaining the flags/options seen
```

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.

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

```sh
# 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
