Skip to main content

chargestat

Mac power adapter, charge rate, and time to full/empty in the terminal. Read-only, no sudo, no dependencies beyond the Python standard library.

chargestat showing a charging snapshot, then a 24-hour charge and battery-power history plot

brew install tjdcs/tap/chargestat

Or try it without installing: uvx chargestat. See Install for other options.

Adapter  100 W · pd charger · 20.0 V × 5.00 A negotiated
PDOs     5V 3A · 9V 3A · 15V 3A · [20V 5A]
Status   Charging  23% █████░░░░░░░░░░░░░░░
Rate     +476 mA · +9.0 %/h
Time     10h 14m to full (macOS)
Power    ~14.0 W in → 8.8 W system, +5.3 W battery · ~14.9 W at wall
Battery  1169/5312 mAh · 11.44 V · 30.6 °C
Health   85% of design (6249 mAh) · 437 cycles
Updated  9 s ago by battery gauge

Install

Requires macOS. Homebrew provides Python; with uv, any Python ≥ 3.10 works.

Homebrew uv pipx
Install brew install tjdcs/tap/chargestat uv tool install chargestat pipx install chargestat
Upgrade brew upgrade chargestat uv tool upgrade chargestat pipx upgrade chargestat
Uninstall brew uninstall chargestat uv tool uninstall chargestat pipx uninstall chargestat

To try it without installing, run uvx chargestat. Add --refresh to pick up a new release.

uvx chargestat fetching chargestat from PyPI on first run and printing a snapshot

Check the installed version with chargestat -V. CHANGELOG.md lists CLI and install changes for each release.

Usage

chargestat              # one snapshot
chargestat -w           # live view, refresh every 2 s (Ctrl-C to stop)
chargestat -w 5 -n 12   # 12 refreshes, 5 s apart
chargestat --json       # machine-readable; with -w, one JSON object per line
chargestat -H           # plot charge and battery power over the last 24 h
chargestat -H 6         # ... over the last 6 h (system powerlog keeps ~2-3 days)

Exit status is 2 when the Mac has no battery.

What the rows mean

Row Source (ioreg -rn AppleSmartBattery) Notes
Adapter AdapterDetails Negotiated USB-PD contract, not live draw.
PDOs AdapterDetails.UsbHvcMenu Fixed-supply PDOs the charger advertises; [ ] marks the active one.
Rate InstantAmperage, AppleRawMaxCapacity Gauge current into (+) or out of (−) the pack, and the resulting SoC change per hour.
Time AvgTimeToFull/AvgTimeToEmpty; mAh ÷ mA macOS's estimate, plus a linear estimate at the present current. The linear one ignores the constant-voltage taper, so it reads short near full.
Power PowerTelemetryData Estimates (~). Input = system load + battery branch; "at wall" adds the reported adapter efficiency loss.
Battery / Health AppleRawCurrentCapacity, DesignCapacity, CycleCount Health is full-charge capacity ÷ design capacity.
Updated UpdateTime The gauge refreshes every ~15–60 s, so consecutive samples often repeat.

NotChargingReason / SlowChargingReason are shown as raw hex because Apple doesn't document the bits.

Tested on Apple silicon. Intel Macs report capacities in mAh directly; that path is handled but untested on hardware.

Development

uv run chargestat
uv run pytest
uv run ruff check . && uv run ruff format --check .

See RELEASING.md for the PyPI and Homebrew release process.

Metadata

Release files for chargestat 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chargestat 0.1.2
File Size Uploaded Provenance Actions
chargestat-0.1.2.tar.gz 14.8 kB Without provenance Details for chargestat-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for chargestat 0.1.2
File Interpreter ABI Platform Actions
chargestat-0.1.2-py3-none-any.whl Python 3 none any Details for chargestat-0.1.2-py3-none-any.whl

Total release size: 30.8 kB

Release files / chargestat-0.1.2.tar.gz

Download URL chargestat-0.1.2.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c27d07554ce71160327aab91fc344f939662e2139b2d7a5cfd30ffd73b3c4543
BLAKE2b-256 checksum
How to use checksums
81091c2243a9eb460b1124a913e3b91443f4b0c6cd1334cb544830aa9a4484f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / chargestat-0.1.2-py3-none-any.whl

Download URL chargestat-0.1.2-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1dd0b3c036eb45e6cf89dd9ea6640ecd1dc1ea61897636e28513ccdc5b326c6b
BLAKE2b-256 checksum
How to use checksums
15ba825405dcd62e34e3c24d2a8bd48ed5ee34b5dc1edb68205d7e8d44b80fd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for chargestat 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page