EnvWipe - Automated Python Virtual Environment Cleaner
This project provides a Golang based tool to automatically identify, delete, and manage old Python virtual environments (venvs) on your local computer. It also logs the paths of deleted environments and manages these logs by periodically cleaning up older entries.
Features
Installation
-
Clone the Repository:
git clone https://github.com/Ashad/envwipe.git
cd envwipe
-
Build the Project:
go build -o envwipe main.go
-
Configure the Script:
- Modify the
config.json file to specify the directories to scan, the age threshold for deleting virtual environments, and log retention policies.
Usage
-
Run the Script:
./envwipe
-
Dry Run Mode:
- To see what would be deleted without actually deleting anything:
./envwipe --dry-run
-
Specify a Custom Config File:
Configuration
The config.json file allows you to customize the behavior of the script. Key settings include:
- Directories to Scan: Specify the directories where the script should look for virtual environments.
- Age Threshold: Define how old a virtual environment must be before it is considered for deletion.
- Log Retention Policy: Set how long logs should be kept before they are automatically deleted.
Example config.json:
{
"scanDirectories": [
"/path/to/projects",
"/another/path/to/scan"
],
"thresholdDays": 30,
"logDirectory": "/path/to/logs",
"logRetentionDays": 60
}
Contributing
Contributions are welcome! Please fork the repository and create a pull request with your changes.
License
This project is licensed under the MIT License.