Find and delete Python virtual environments to free disk space
Project description
Better VenvKiller 🗑️
Find and delete Python virtual environments to free disk space. Works on Windows, macOS, and Linux.
Features
- 🔍 Smart Detection: Finds both Python venvs and Conda environments
- 📊 Size Analysis: Shows disk usage for each environment
- 🎯 Flexible Filtering: Filter by size, age, and type
- 🖥️ Dual Interface: Command-line and GUI versions
- 🛡️ Safety First: Dry-run mode and confirmation prompts
- ⚡ Fast Scanning: Optimized directory traversal
- 🎨 User Friendly: Clean interface with progress indicators
Installation
pip install better-venv-killer
Usage
Command Line Interface
# Basic usage - scan home directory
better-venv-killer
# Scan specific paths
better-venv-killer /projects /home/user/dev
# Dry run (preview only)
better-venv-killer --dry-run
# Filter by size and age
better-venv-killer --min-size 100MB --older-than 30
# Include Conda environments
better-venv-killer --include-conda
# Limit scan depth for performance
better-venv-killer --max-depth 5
GUI Interface
# Launch the GUI
better-venv-killer-gui
The GUI provides:
- ➕ Add/remove scan paths with folder browser
- 🔧 All CLI options as visual controls
- ☑️ Interactive selection with checkboxes
- 📊 Real-time size calculations
- 🛡️ Built-in dry-run mode
Options
| Option | Description | Example |
|---|---|---|
--dry-run |
Preview what would be deleted | --dry-run |
--min-size |
Minimum size filter | --min-size 100MB |
--older-than |
Age filter in days | --older-than 30 |
--include-conda |
Include Conda environments | --include-conda |
--max-depth |
Maximum scan depth | --max-depth 5 |
Size Formats
Supports: B, KB, MB, GB, TB
Examples: 100MB, 1.5GB, 500KB
What Gets Detected
Python Virtual Environments:
.venv,venv,env,.envfolders- Detected by
pyvenv.cfg,Scripts/python.exe,bin/python - Cross-platform compatible
Conda Environments:
- Detected by
conda-metafolder - Requires
--include-condaflag
Safety Features
- 🔍 Dry Run Mode: See what would be deleted without actually deleting
- ⚠️ Confirmation Prompts: Always asks before deletion
- 📊 Size Preview: Shows total space to be freed
- 🚫 Error Handling: Graceful handling of permission errors
- 📝 Detailed Logging: Clear feedback on operations
Examples
# Find all environments larger than 500MB
better-venv-killer --min-size 500MB --dry-run
# Clean up old environments (older than 60 days)
better-venv-killer --older-than 60
# Comprehensive scan including Conda
better-venv-killer --include-conda --min-size 100MB
# Quick scan with limited depth
better-venv-killer --max-depth 3 ~/projects
Requirements
- Python 3.7+
- No external dependencies (uses only standard library)
- Works on Windows, macOS, and Linux
License
MIT License - see LICENSE file for details.
Contributing
Contributions welcome! Please feel free to submit issues and pull requests.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file better_venv_killer-1.0.0.tar.gz.
File metadata
- Download URL: better_venv_killer-1.0.0.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56ed5de2bfdd4589aafddb7c4d0116e7e279c8b092458bc86aca74b574fe445d
|
|
| MD5 |
7c215dc2d8ad36090a3f95db533a4379
|
|
| BLAKE2b-256 |
9f63f8e4ef43c0846728214d0fabb874bc31bdcf7d596e9dc407707889972d2e
|
File details
Details for the file better_venv_killer-1.0.0-py3-none-any.whl.
File metadata
- Download URL: better_venv_killer-1.0.0-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a073c7a1588fa36e42a468f650de9d4997ae896bac26013aebf444818abc323
|
|
| MD5 |
fb9e3dc53a5ed3011171f672c412597d
|
|
| BLAKE2b-256 |
9257cd124fd651b37975d1c201ae5d37790f31bb982197dcb6cb634136d2571c
|