Metadata-Version: 2.4 Name: plex-reaper Version: 0.2.0a1 Summary: Evidence-first Plex library pruning: find what nobody wanted, review it in a TUI, remove it through Radarr/Sonarr. Author: Aubrey License: MIT License Copyright (c) 2026 Aubrey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Project-URL: Homepage, https://github.com/alewman/plex-reaper Project-URL: Issues, https://github.com/alewman/plex-reaper/issues Keywords: plex,tautulli,radarr,sonarr,cleanup,tui Classifier: Development Status :: 3 - Alpha Classifier: Environment :: Console Classifier: License :: OSI Approved :: MIT License Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 Classifier: Programming Language :: Python :: 3.14 Classifier: Topic :: Multimedia :: Video Requires-Python: >=3.12 Description-Content-Type: text/markdown License-File: LICENSE Requires-Dist: httpx>=0.27 Requires-Dist: pydantic>=2.7 Requires-Dist: textual>=0.80 Requires-Dist: typer>=0.12 Provides-Extra: dev Requires-Dist: pytest>=8; extra == "dev" Requires-Dist: pytest-asyncio>=0.23; extra == "dev" Requires-Dist: respx>=0.21; extra == "dev" Requires-Dist: ruff>=0.5; extra == "dev" Dynamic: license-file # PlexReaper > Find what nobody wanted. Decide with evidence. Remove it through Radarr/Sonarr. PlexReaper scores every movie and show on a shared Plex server for removal, using **what people actually did** rather than a single "watched" bit: - Playback sessions from **every Tautulli instance** you run, classified by how far they got. A genuine watch is 85%+. A session that stopped between 15% and 85% is someone who tried it and bailed, which counts *against* the title. A short session by the admin right after the file arrived is quality sampling and is ignored. - Plex's own all-accounts history as a weak prior for watches before Tautulli. - Age, size, bytes-per-hour (bloated encodes), rating, collections, and how far into a show anyone got. Each title gets a **reap score** from 0 to 100 made of named signals with one-line reasons, and you review them in a terminal UI that remembers every decision. See [`docs/design-brief.md`](docs/design-brief.md) for the model and the phase plan. **Status: phase 1.** Scanning, scoring, the TUI and the decision ledger work. Nothing is deleted yet; marked items export to JSON. Phase 2 adds execution through Radarr/Sonarr (files removed, entry kept), downgrade-instead-of-delete, a leaving-soon collection, and on-the-fly enrichment from Ombi, Prowlarr and TMDB. ## Install ```bash git clone https://github.com/alewman/plex-reaper.git cd plex-reaper python -m venv .venv && .venv/bin/pip install -e . cp plex-reaper.example.toml plex-reaper.toml # edit Tautulli paths, protections, weights cp .env.example .env # PLEX_URL, PLEX_TOKEN .venv/bin/plex-reaper check ``` Python 3.12 or newer. The Tautulli databases are read directly and read-only (`mode=ro&immutable=1`), so the files must be readable by the user running the tool. The Plex client only ever issues GET requests. ## Use ```bash plex-reaper libraries # find section ids plex-reaper scan # top 50 candidates as a table plex-reaper scan --json --limit 0 # everything, for scripts plex-reaper tui # review interactively plex-reaper decisions # what the ledger remembers plex-reaper export reap-list.json # marked items, for phase 2 ``` The Plex inventory is cached (12 hours by default); `--refresh` forces a new pull. Tautulli is re-read on every run because it is local and fast. ### The TUI | Key | Action | | --- | --- | | `space` | mark / unmark for reaping | | `k` | keep (hidden from future lists; `h` shows them) | | `d` | mark for downgrade (phase 2 acts on it) | | `p` | protect | | `u` | clear the decision | | `/` | filter by title, library or genre | | `s` | cycle sort: score, size, age, title | | `x` | review marked items; `e` there exports JSON | | `q` | quit | Decisions are written to the ledger the moment you press the key. ## How the score works Positive signals argue for removal, negative ones for keeping. Defaults: | Code | Meaning | Points | | --- | --- | --- | | `NEVER` | no genuine watch on any server, no Plex history | +30 | | `GHOST` | only sub-15% sessions ever | +5 | | `ABANDON` | each non-admin session that bailed (cap 3) | +8 | | `AGE` | 1 to 4 years in the library | +0 to +15 | | `SIZE` | 1 GB to 100 GB, log scale | +0 to +15 | | `BLOAT` | more than 8 GB per hour of runtime; flags *downgrade* | +5 | | `LOWRATE` | audience rating ≤ 5.0 / ≤ 3.0 | +5 / +10 | | `STALLED` | show nobody got past season 1 of; flags *trim* | +10 | | `WATCHED` | genuine watches, more users count more | −40 to −70 | | `RECENT` | watched in the last year | −20 | | `PRIOR` | Plex history only | −25 | | `SIBLING` | a title in the same collection was watched | −15 | | `PROTECTED` | genre, title pattern or library rule | score 0 | All weights are in `plex-reaper.toml`. ## Safety Phase 1 performs no writes outside its own ledger and cache. The old v0.1 text-selection workflow and its Radarr/Sonarr code were removed; they return in phase 2 behind the review screen with dry-run. ## Development ```bash .venv/bin/pip install -e '.[dev]' .venv/bin/pytest -q .venv/bin/ruff check plexreaper tests ``` ## License [MIT](LICENSE)