Skip to main content

A command-line tool to reset your global Python environment.

Project description

PyWipe

Language License Python Version

A command-line tool to reset your global Python environment.

pywipe acts as a 'factory reset' for your global Python installation, safely removing all user-installed packages while preserving essential ones like pip and setuptools. It's designed to clean up cluttered global environments without affecting your isolated virtual environments.

Why PyWipe?

Over time, your global Python space can become a tangled mess of packages from various projects, leading to version conflicts, slower startup times, and the infamous "it works on my machine" syndrome. Manually cleaning this up is tedious and risky. PyWipe automates this process, providing a safe and reliable "factory reset" button for your Python environment.

✨ Features

  • 🧹 Clean Global Environment: Uninstalls all packages installed in the global Python site-packages directory.
  • 🛡️ Essential Package Protection: Automatically whitelists critical packages (pip, setuptools, etc.) to ensure your Python installation remains functional.
  • Custom Whitelisting: Allows you to specify additional packages to keep using the --keep option.
  • 💾 Automatic Backup: Creates a timestamped backup file (pywipe_backup_YYYY-MM-DD_HH-MM-SS.txt) listing all installed packages before uninstallation, allowing for easy restoration if needed (though restoration is currently a manual process using pip install -r <backup_file>).
  • 👀 Dry Run Mode: Use the --dry-run flag to see exactly which packages would be uninstalled without actually performing the action.
  • ⚠️ Virtual Environment Safety: Prevents accidental execution inside a virtual environment, protecting your isolated project dependencies.
  • Rich Output: Provides clear, colorful console output using the rich library.

📚 Tech Stack

  • Python
  • Click: For building the command-line interface.
  • Rich: For beautiful and informative console output.
  • setuptools: Standard Python package building tools.

🚀 Installation

pywipe is a Python package and can be installed globally using pip:

pip install pywipe

Note: This tool is specifically designed for your global Python environment. Do not install or run it inside a virtual environment.

▶️ Usage

Run the pywipe run command to initiate the cleanup process.

pywipe run

You will be shown a list of packages to be uninstalled (excluding essential and whitelisted packages) and prompted for confirmation before proceeding.

Keep specific packages:

Use the --keep or -k option followed by the package name to prevent it from being uninstalled. You can specify this option multiple times for different packages.

pywipe run --keep my-essential-tool --keep another-package-to-keep

Dry run:

To see which packages would be uninstalled without actually uninstalling them, use the --dry-run flag.

pywipe run --dry-run

🤝 Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

📝 License

Distributed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pywipe-1.0.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pywipe-1.0.1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file pywipe-1.0.1.tar.gz.

File metadata

  • Download URL: pywipe-1.0.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for pywipe-1.0.1.tar.gz
Algorithm Hash digest
SHA256 ca410972d7455cafbf4136033209161e0e62d45774c694ebbb3e0737a16c26e8
MD5 b664ecaad9955c33e006d5e66821a2bb
BLAKE2b-256 d3dabb0a0f01f097df9fef8ecb70ac44fc85f90f43970b9b3459ebdfc82006c5

See more details on using hashes here.

File details

Details for the file pywipe-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pywipe-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for pywipe-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 86d61829c34c5c9d477cd8a40c92cc7b85d8b110e023bccc3925845fabcd869d
MD5 9c6c3efbd374fbb92344ff9cba2bcdbc
BLAKE2b-256 4da8310fb1593075b757eaa6131a8cebae3cfeea9fe03db563b47a9b18dbab42

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page