Metadata-Version: 2.4
Name: pkgwise
Version: 0.1.1
Summary: Know what you're updating before you update — a smart Linux update analyzer.
Author: PkgWise Developers
License: MIT
Project-URL: Homepage, https://github.com/Senpi-Station/PkgWise
Project-URL: Repository, https://github.com/Senpi-Station/PkgWise
Project-URL: Issues, https://github.com/Senpi-Station/PkgWise/issues
Project-URL: Changelog, https://github.com/Senpi-Station/PkgWise/blob/main/CHANGELOG.md
Keywords: linux,packages,updates,pacman,apt,tui,system-administration
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: psutil<7,>=5.9
Requires-Dist: textual<2,>=0.60
Provides-Extra: test
Requires-Dist: pytest>=7; extra == "test"
Requires-Dist: pytest-cov>=4; extra == "test"
Requires-Dist: pytest-asyncio>=0.23; python_version >= "3.9" and extra == "test"
Dynamic: license-file

<h1 align="center">PkgWise</h1>

<p align="center">
  <b>Know what you're updating before you update.</b><br/>
  A conservative Linux package-update analyzer for Arch (pacman) and Debian-family (apt) systems.
</p>

<p align="center">
  <a href="https://github.com/Senpi-Station/PkgWise/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License"></a>
  <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.9%2B-blue" alt="Python 3.9+"></a>
  <a href="https://github.com/Senpi-Station/PkgWise"><img src="https://img.shields.io/badge/repo-github-181717?logo=github" alt="GitHub"></a>
</p>

PkgWise checks for available updates **without installing anything**, shows you what
is waiting (name, versions, sizes, security and reboot hints), scores each update with
a **transparent, conservative priority**, and only ever runs a real update after you
explicitly confirm the exact command.

## Features

- **Dual package managers** — `pacman` (Arch) and `apt-get`/`apt-cache` (Debian, Kali, Ubuntu).
- **Sizes you can plan with** — download and installed sizes are read from the package
  manager's own metadata, never guessed.
- **Transparent priorities** — every CRITICAL/HIGH/MEDIUM/LOW label comes with the
  human-readable reasons behind it. Unknown facts are shown as “Unknown”, never invented.
- **Security-first updates** — nothing runs automatically, nothing is removed or cleaned,
  empty selections can never trigger a full-system upgrade, and disk-space + privilege
  checks gate every real update.
- **Two interfaces** — a fast terminal CLI and a Textual TUI with selection, detail and
  confirmation screens.
- **Mock mode** — preview the whole tool on any machine without touching a real package
  manager.

## Installation

```bash
pip install pkgwise
```

One command installs everything: the CLI, the TUI, and the storage analysis (psutil/textual are bundled automatically). Requires Python 3.9+. Works on Arch-based and Debian-based Linux systems.

## Quick start

```console
$ pkgwise check                 # storage summary + available updates, prioritized
$ pkgwise updates               # just the pending updates
$ pkgwise storage               # disk information only (no package manager needed)
$ pkgwise --refresh             # refresh package indexes first (network)
$ pkgwise                      # launch the interactive TUI
$ pkgwise --version             # version and system info
```

## Example output

```
STORAGE
  Total : 291.4 GB
  Used  : 87.3 GB
  Free  : 189.2 GB
  Usage : 30.0%
  System: Arch Linux (pacman)

UPDATES (3 available, ~150 MB to download)
  🔴 CRITICAL  openssl          3.0.1 -> 3.0.2   Security-related update        (2.5 MB / 9 MB)
  🟠 HIGH      linux            6.0.1 -> 6.0.2   Kernel package — needs reboot  (38 MB / 700 MB)
  🟡 MEDIUM    figlet           2.2.5 -> 2.2.6   No security metadata detected  (0.5 MB / 1 MB)
```

## How priorities work

PkgWise collects only **observable facts** about a package — security metadata, whether it
is a kernel, a core system component or a system library — and maps them through a small,
documented scoring table in [pkgwise/core/priority.py](https://github.com/Senpi-Station/PkgWise/blob/main/pkgwise/core/priority.py). Labels always come with their
reasons, so nothing is ever marked important without an explanation.

## Safety model

| Guarantee | Where enforced |
| --- | --- |
| Nothing runs automatically | `cli.py`, TUI confirm screens |
| Exact command shown before running | backends' `install_command()` |
| Empty selection can't upgrade everything | backends return `[]` for empty selections |
| Disk-space check before install | `analyzer.prepare_update()` |
| Privilege check before install | `analyzer.prepare_update()` |
| No packages removed or cleaned | analyzer never invokes remove/clean |

## Development

```bash
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[test]"
pytest
```

See [CONTRIBUTING](https://github.com/Senpi-Station/PkgWise/blob/main/docs/CONTRIBUTING.md) and [DEVELOPMENT](https://github.com/Senpi-Station/PkgWise/blob/main/docs/DEVELOPMENT.md).

## License

Released under the [MIT License](https://github.com/Senpi-Station/PkgWise/blob/main/LICENSE).
