Metadata-Version: 2.4
Name: ppop
Version: 0.1.0
Summary: An interactive PPU process viewer and resource monitor, inspired by nvitop.
Author-email: Zhongwang Lun <lunandcnn@gmail.com>
License-Expression: MIT
Keywords: ppu,monitor,process-viewer,tui
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console :: Curses
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: psutil>=5.6.6
Dynamic: license-file

# ppop

An interactive PPU process viewer and resource monitor for the terminal, inspired by [nvitop](https://github.com/XuehaiPan/nvitop).

## Features

- Real-time PPU device monitoring (utilization, memory, temperature, power)
- Host CPU and memory usage display
- Per-process PPU memory tracking
- Interactive curses-based TUI with color-coded utilization bars
- Non-interactive one-shot mode for scripts and logging

## Demo

```
+-------------------------------------------------------------------------------+
| ppop - PPU Monitor                               Driver Version: 1.5.5-7a3ae6 |
+-----------------------------------+----------------------+-------------------+
|              PPU  Name             |      Memory-Usage     |      PPU-Util      |
+===================================+======================+===================+
| 0  PPU-ZW810E  32C  71W / 400W     |      2MiB / 98304MiB |       0%  Default |
| 1  PPU-ZW810E  32C  75W / 400W     |      2MiB / 98304MiB |       0%  Default |
+-----------------------------------+----------------------+-------------------+

+-------------------------------------------------------------------------------+
| Host:                                                                          |
| CPU [||||                ]  21.3% (32 cores)    MEM [||||||              ] 32.1GiB/64.0GiB (50.2%)
+-------------------------------------------------------------------------------+

+-------------------------------------------------------------------------------+
| Processes:                                                                     |
| PPU       PID  USER         PPU-MEM   CPU%   MEM%       TIME  Command         |
+===============================================================================+
|   0    12345  user           8192MiB   3.2%  12.6%      1:23  python train.py |
+-------------------------------------------------------------------------------+
```

## Requirements

- Python 3.8+
- PPU device with `ppu-smi` installed (default path: `/usr/local/PPU_SDK/ppu-smi/bin/ppu-smi`)

## Installation

### From source

```bash
git clone https://github.com/your-username/ppop.git
cd ppop
pip install .
```

### From PyPI (coming soon)

```bash
pip install ppop
```

## Usage

```bash
# Interactive mode (real-time monitoring)
ppop

# One-shot mode (print once and exit)
ppop --once

# Custom refresh interval (default: 2s)
ppop -i 5
```

### Keyboard Shortcuts (interactive mode)

| Key | Action |
|-----|--------|
| `q` | Quit |
| `↑` / `k` | Scroll up |
| `↓` / `j` | Scroll down |
| `PgUp` / `PgDn` | Scroll by page |
| `r` | Force refresh |

## Configuration

If `ppu-smi` is not at the default path, set the environment variable:

```bash
export PPU_SMI_PATH=/path/to/ppu-smi
```

## License

[MIT](LICENSE)
