Skip to content

OPCraniX/PPPU

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

PPPU

PPPU is a PowerShell 7+ script for updating pip and installed Python packages with optional virtual environment support, parallel upgrades, dependency health checks, and timestamped logging.

The repository currently ships a single script, PPPU.ps1, which is designed for Windows environments where Python is already installed or available inside a virtual environment.

The script can also check Python.org at runtime to compare your installed interpreter against the latest stable Python 3 release, while falling back to a configured version if the site is unavailable.

What It Does

  • Detects the Python interpreter to use.
  • Optionally works inside a virtual environment.
  • Can create the virtual environment if it does not exist.
  • Upgrades pip before checking packages.
  • Finds outdated packages with pip list --outdated --format=json.
  • Updates packages in parallel with a configurable throttle limit.
  • Runs pip check after updates.
  • Optionally attempts automatic repair for common dependency conflicts.
  • Writes a timestamped log file for every run.

Requirements

  • Windows
  • PowerShell 7 or newer
  • Python available on PATH, or a virtual environment you want to target

Usage

Run the script from PowerShell:

.\PPPU.ps1

Common examples:

.\PPPU.ps1 -UseVenv
.\PPPU.ps1 -UseVenv -VenvPath ".\.venv"
.\PPPU.ps1 -UseVenv -CreateVenvIfMissing
.\PPPU.ps1 -MaxParallel 4
.\PPPU.ps1 -AutoFixBrokenDeps
.\PPPU.ps1 -UseVenv -CreateVenvIfMissing -AutoFixBrokenDeps

Parameters

Parameter Description
-UseVenv Use the Python interpreter from a virtual environment.
-VenvPath Path to the virtual environment. Default: .\.venv
-CreateVenvIfMissing Create the virtual environment when -UseVenv is set and the target does not exist.
-MaxParallel Maximum number of package upgrades to run in parallel. Default: 4
-AutoFixBrokenDeps Attempt repairs when pip check reports broken dependencies.
-RecommendedPython Fallback version string used when the online Python.org lookup is skipped or unavailable. Default: 3.14
-SkipOnlinePythonRecommendation Disable the live Python.org lookup and use only the configured fallback version.
-PythonDownloadsUrl Python.org downloads page used for the live version check. Default: https://www.python.org/downloads/
-LogDirectory Directory where timestamped logs are written. Default: .\logs

Notes

  • The script upgrades packages in the selected interpreter, so using a virtual environment is recommended when you want to limit impact.
  • By default, the recommendation check tries to detect the latest stable Python 3 version from Python.org and falls back to -RecommendedPython if the lookup fails.
  • PowerShell 7 is required because the updater uses ForEach-Object -Parallel.
  • The script pauses at the end with Read-Host "Press Enter to exit" so it is friendly to double-click or manual terminal runs.
  • The header comments in the script still show pip-updater.ps1 in some examples, but the file in this repository is named PPPU.ps1.

Logging

Each run creates a log file in the configured log directory using this format:

logs\pip-updater_yyyy-MM-dd_HH-mm-ss.log

The log captures step-by-step execution, package updates, warnings, and errors.

Safety Reminder

Package upgrades can introduce breaking changes, especially in shared or system-wide Python installations. If you are updating project dependencies, run PPPU inside that project's virtual environment whenever possible.

About

Python, PIP & Packages Updater

Resources

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages