{"id":19560389,"url":"https://github.com/ashad001/envwipe","last_synced_at":"2025-02-26T08:29:07.087Z","repository":{"id":254603481,"uuid":"846540753","full_name":"Ashad001/EnvWipe","owner":"Ashad001","description":"Automatically clean up old Python virtual environments, clean up logs, and get a quick report after each run.","archived":false,"fork":false,"pushed_at":"2024-08-25T15:28:51.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T09:38:58.533Z","etag":null,"topics":["clear","environment-cleaner","golang","venv-python","virtual-environment-cleaner"],"latest_commit_sha":null,"homepage":"https://medium.com/@ashad001sp/automating-virtual-environment-cleanup-a-go-powered-solution-for-developers-51095b840022","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ashad001.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-23T12:32:56.000Z","updated_at":"2024-09-02T08:58:24.000Z","dependencies_parsed_at":"2024-08-24T18:14:52.232Z","dependency_job_id":null,"html_url":"https://github.com/Ashad001/EnvWipe","commit_stats":null,"previous_names":["ashad001/envwipe"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashad001%2FEnvWipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashad001%2FEnvWipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashad001%2FEnvWipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashad001%2FEnvWipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ashad001","download_url":"https://codeload.github.com/Ashad001/EnvWipe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240817462,"owners_count":19862482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clear","environment-cleaner","golang","venv-python","virtual-environment-cleaner"],"created_at":"2024-11-11T05:07:25.308Z","updated_at":"2025-02-26T08:29:07.034Z","avatar_url":"https://github.com/Ashad001.png","language":"Go","readme":"# EnvWipe - Automated Python Virtual Environment Cleaner\n\nThis 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.\n\n## Features\n\n- **Automatic Identification of Virtual Environments:**\n  - Scans specified directories to find Python virtual environments (`venv` or `.venv` folders).\n  - Deletes virtual environments that are older than a user-defined threshold (e.g., 30 days).\n\n- **Logging:**\n  - Logs the paths of all deleted virtual environments.\n  - Logs are stored in a specified directory and are timestamped for easy reference.\n\n- **Automated Log Cleanup:**\n  - Periodically cleans up old log files based on user-defined retention policies.\n  - Provides a summary report after each cleanup, showing the logs retained and those deleted.\n\n- **Summary Reporting:**\n  - After each run, generates a summary report detailing:\n    - The paths of deleted virtual environments.\n    - The number of log files cleaned up.\n    - Any errors encountered during the process.\n\n## Installation\n\n1. **Clone the Repository:**\n   ```sh\n   git clone https://github.com/Ashad/envwipe.git\n   cd envwipe\n   ```\n\n2. **Build the Project:**\n   ```sh\n   go build -o envwipe main.go\n   ```\n\n3. **Configure the Script:**\n   - Modify the `config.json` file to specify the directories to scan, the age threshold for deleting virtual environments, and log retention policies.\n\n## Usage\n\n1. **Run the Script:**\n   ```sh\n   ./envwipe\n   ```\n\n2. **Dry Run Mode:**\n   - To see what would be deleted without actually deleting anything:\n     ```sh\n     ./envwipe --dry-run\n     ```\n\n3. **Specify a Custom Config File:**\n   - Use a custom configuration file:\n     ```sh\n     ./envwipe --config /path/to/your/config.json\n     ```\n\n## Configuration\n\nThe `config.json` file allows you to customize the behavior of the script. Key settings include:\n\n- **Directories to Scan:** Specify the directories where the script should look for virtual environments.\n- **Age Threshold:** Define how old a virtual environment must be before it is considered for deletion.\n- **Log Retention Policy:** Set how long logs should be kept before they are automatically deleted.\n\nExample `config.json`:\n```json\n{\n  \"scanDirectories\": [\n    \"/path/to/projects\",\n    \"/another/path/to/scan\"\n  ],\n  \"thresholdDays\": 30,\n  \"logDirectory\": \"/path/to/logs\",\n  \"logRetentionDays\": 60\n}\n```\n\n## Contributing\n\nContributions are welcome! Please fork the repository and create a pull request with your changes.\n\n## License\n\nThis project is licensed under the MIT License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashad001%2Fenvwipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashad001%2Fenvwipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashad001%2Fenvwipe/lists"}