Skip to main content

TUI process monitor that groups processes by application

Project description

ptop3

PyPI version Python versions CI License: MIT

An htop-like TUI process monitor that groups processes by application.

Screenshots

Group view Main group view — processes grouped by application

Detail view Detail view — individual processes for a selected group

Tree view Tree view — process hierarchy within a group

Features

  • Groups processes by application name with smart alias resolution
  • Colored header with memory, swap, load-average badges
  • Sort by memory, CPU, RSS, swap, I/O, network, or count
  • Regex filter across app name, process name, and cmdline
  • Process tree view within a selected application group
  • Kill signals (SIGTERM / SIGKILL) for individual processes or entire groups
  • w key: clean swap by cycling swapoff/swapon (passwordless sudo)
  • d key: drop kernel caches (passwordless sudo)
  • Alerts for high CPU, memory, swap, disk usage, and zombie processes
  • Lite mode (--lite) for lower overhead on busy systems

Installation

pip install ptop3

Quick Start

ptop3                 # interactive TUI
python -m ptop3       # same via module
ptop3 --once          # print one-shot table and exit
ptop3 --filter python # filter to python processes

Sudo Setup

The w (swap-clean) and d (drop-caches) keys require root. Configure passwordless sudo once:

sudo ptop3 --init-subscripts

Or manually:

sudo visudo -f /etc/sudoers.d/ptop3
# Add:
# YOUR_USER ALL=(root) NOPASSWD: /path/to/ptop3-drop-caches
# YOUR_USER ALL=(root) NOPASSWD: /path/to/ptop3-swap-clean

Check sudo status:

ptop3 --check-sudo

CLI Reference

Flag Default Description
--once off Print one-shot table and exit
-f/--filter REGEX Filter by app/name/cmdline
-s/--sort KEY mem Sort key: mem, cpu, rss, swap, io, net, count
-n/--top N 15 Rows to show in --once mode
--refresh SECS 2.0 Refresh interval
--lite off Lite mode: skip cmdline/IO for tiny procs
--check-sudo Check sudo config for subscripts
--init-subscripts Write /etc/sudoers.d/ptop3

Key Bindings

Key Action
↑/↓ or j/k Move selection
PgUp/PgDn Page up/down
Home/End Jump to first/last
Enter or l Expand group to detail view
h Back to group view
t Toggle process tree (detail view)
s Cycle sort key
f Enter filter regex
r Reset filter
+/- Increase/decrease refresh interval
k/K Send SIGTERM/SIGKILL to selected
g Kill whole group (SIGTERM)
w Run swap-clean
d Drop caches
q or Ctrl-C Quit

Subscripts

The privileged subscripts can also be run directly:

ptop3-drop-caches --help
ptop3-drop-caches --level 1 --dry-run

ptop3-swap-clean --help
ptop3-swap-clean --safety-mb 256 --dry-run

Development

git clone https://github.com/yourusername/ptop3
cd ptop3
pip install -e ".[dev]"
pytest
ruff check ptop3/

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

ptop3-0.1.1.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

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

ptop3-0.1.1-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file ptop3-0.1.1.tar.gz.

File metadata

  • Download URL: ptop3-0.1.1.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ptop3-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bf0f30d32e81bf1e58660a2acdd2c2bfe0880316790fe791c1775f4ecd72fd6c
MD5 af23aac72ab347bb9dd42fb5c2ae7e2d
BLAKE2b-256 38d865c3a41201de3190d9689f247e8bc490ccb28f88276b53341d97919e3a25

See more details on using hashes here.

File details

Details for the file ptop3-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ptop3-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ptop3-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a4a1856a9185ddda549988b0cbfd1dab568d6815b259a42fbdceabd022500c7b
MD5 261b4bd9b4b3b5e1e9e83711e976437c
BLAKE2b-256 c1b6af97674093c08f5482d044750206cbc7e265865121a88458f0880f0bb8a0

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