Metadata-Version: 2.4
Name: pkgmap
Version: 1.0.0
Summary: List every installed software package on any Linux distro (rpm, dnf, pacman, flatpak, snap, deb, AppImage, pipx, cargo, npm) with sizes, grouped by family, with delete-by-number
Author: Rami
License: MIT
Keywords: linux,fedora,arch,ubuntu,debian,zorin,rpm,dnf,pacman,flatpak,snap,inventory,package-manager
Classifier: Environment :: Console
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# pkgmap

List **every** piece of installed software on your Linux box — RPM, DNF,
Pacman (Arch), Flatpak, Snap, DEB/DPKG (Ubuntu/Debian/Zorin), AppImages
found on disk, pipx apps and global npm packages — with
sizes, grouped by family (texlive, wine, kernel, perl, …), in a clean
colored terminal report, plus JSON and CSV exports. You can also
uninstall any package directly by its number in the list.

## Install

From anywhere (published on PyPI):

```bash
pip install pkgmap
```

(If your system Python is externally managed, e.g. Fedora, you may need one of):

```bash
pip install --user pkgmap
# or
pipx install pkgmap
```

From this folder (for development):

```bash
pip install .
# editable: pip install -e .
```

## Usage

Once installed, a `pkgmap` command is available anywhere:

```bash
pkgmap
```

Options:

```bash
pkgmap --output-dir ~/Documents   # where to save the JSON/CSV reports
pkgmap --no-color                 # disable colored output (e.g. for piping to a file)
pkgmap --help
```

This prints a numbered, colored table per source (packages sharing the
same family — like `texlive-*`, `wine-*`, `kernel-*` — are grouped into
a single row with their count and total size), a final summary with a
bar chart of disk usage by source, and writes:

- `installed_software_report.json`
- `installed_software_report.csv`

to the output directory (current directory by default).

## What the output looks like

```text
Scanning installed software on fedora...
(this can take a moment, especially the RPM and size scans)

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ 🧩  RPM Packages (all)                                                    ┃
┃   1906 items  •  total size: 34.9 GB                                     ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
     #  NAME                       VERSION            SIZE  EXTRA
  ----------------------------------------------------------------------------------------
     1  aajohan-comfortaa-fonts    3.105-0.9.2…   471.9 KB  noarch | installed ven. 05 juin…
     5  abrt                       14 pkgs          3.6 MB  abrt, abrt-addon-ccpp, abrt-add…
   606  kernel                     22 pkgs          1.1 GB  kernel, kernel, kernel-core, ke…
  1475  perl                       319 pkgs       148.0 MB  perl-Algorithm-Diff, perl-Archi…
  1732  texlive                    4867 pkgs        8.3 GB  texlive-12many, texlive-2up, te…
  1835  wine                       40 pkgs          2.3 GB  wine, wine-alsa, wine-alsa, win…

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ 🎯  DNF User-Installed                                                    ┃
┃   644 items  •  total size: 15.0 GB                                      ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
     #  NAME                       VERSION            SIZE  EXTRA
  ----------------------------------------------------------------------------------------
  1907  aajohan-comfortaa-fonts    3.105-0.9.2…   471.9 KB  noarch
  1908  abrt                       2.17.8-3.fc…     2.7 MB  x86_64
  ...

╔══════════════════════════════════════════════════════════════════════════╗
║  SUMMARY  —  fedora                                                      ║
╚══════════════════════════════════════════════════════════════════════════╝
  RPM Packages (all)       ██████████████████████████████    34.9 GB  (8441 items)
  DNF User-Installed       ████████████░░░░░░░░░░░░░░░░░░    15.0 GB  (644 items)
  Flatpak Apps             ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░          -  (19 items)
  ...

  TOTAL DISK USAGE (installed software): 49.9 GB

✔ Saved JSON report -> ./installed_software_report.json
✔ Saved CSV report  -> ./installed_software_report.csv
```

Every row is numbered. The `#` column is what you use with
`pkgmap delete <number>` to uninstall that package. Rows with a
version like `14 pkgs` are grouped families — the `EXTRA` column shows
the first few member packages, and deleting a group removes the whole
family.

The JSON report contains the full ungrouped detail per source (all
individual packages, versions, sizes), e.g.:

```json
{
  "generated_at": "2026-08-17T13:30:00.123456",
  "hostname": "fedora",
  "total_size_bytes": 53590000000,
  "total_size_human": "49.9 GB",
  "data": {
    "rpm": [{"source": "rpm", "name": "aardvark-dns", "version": "1.17.1-1.fc44", ...}],
    "dnf_user_installed": [],
    "flatpak": [],
    "snap": [],
    "deb_dpkg": [],
    "pacman": [],
    "appimage": [],
    "pipx": [],
    "cargo": [],
    "npm_global": []
  }
}
```

## Delete software by its number

Run `pkgmap`, note the number of the item you want to remove, then:

```bash
pkgmap delete 42
```

It will show you what is about to be removed, ask for confirmation, and
run the right uninstaller for the package source (dnf/rpm, pacman,
apt, flatpak, snap, pipx, cargo, npm — AppImages are deleted directly).
Group rows (e.g. `texlive (104 pkgs)`) remove the whole family.

## Supported distros

- Fedora / RHEL / CentOS (rpm, dnf)
- Arch / Manjaro (pacman)
- Ubuntu / Debian / Zorin / Mint (deb/dpkg)
- Any distro with flatpak, snap, AppImages, pipx, cargo or npm

## Uninstall

```bash
pip uninstall pkgmap
```
