env_cleanup_utils
A Python package for cleaning up virtual environments (venv), __pycache__, and node_modules directories within a directory tree. It also saves the requirements of virtual environments to a requirements.txt file.
It is capable of traversing the subdirectories and finding all virtual environments
Installation
You can install the env_cleanup_utils package using pip:
pip install env_cleanup_utils
Usage
Command Line Usage
You can use env_cleanup_utils as a command-line utility by running the following command:
python -m env_cleanup_utils [OPTIONS] ROOT_DIR
Replace ROOT_DIR with the root directory where you want to search for virtual environments.
Options:
--delete-all: Delete venvs,__pycache__, andnode_modulesdirectories.--delete-venv: Delete virtual environments.--delete-pycache: Delete__pycache__directories (confirmed automatically).--delete-node: Deletenode_modulesdirectories.-y: Auto-confirm all deletion prompts.--debug: Enable debug mode for additional logging.
Python API
You can also use env_cleanup_utils programmatically in your Python code. Import the necessary functions and classes from the package and call them as needed.
Example:
from env_cleanup_utils import (
find_venv_dirs,
find_pycache_dirs,
find_node_modules_dirs,
save_requirements,
delete_venv,
delete_pycache,
delete_node_modules,
)
# Use the functions and classes as needed.
Sample Usage
# Example command line usage:
python -m env_cleanup_utils ./my_project_directory --delete-venv --debug
# Example Python API usage:
from env_cleanup_utils import (
find_venv_dirs,
save_requirements,
delete_venv,
)
root_dir = "./my_project_directory"
venv_dirs = find_venv_dirs(root_dir)
for venv_dir in venv_dirs:
save_requirements(venv_dir)
delete_venv(venv_dir)
Contributing
If you would like to contribute to the development of the env_cleanup_utils package by adding more functionality, you are welcome to open a pull request.
References
Please ensure you have the required permissions before running the tool, and use it responsibly. This package is provided as-is, without any warranty or guarantee.
Metadata
Release files for env-cleanup-utils 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| env_cleanup_utils-0.1.0.tar.gz | 2.0 kB | Without provenance | Details for env_cleanup_utils-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| env_cleanup_utils-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for env_cleanup_utils-0.1.0-py3-none-any.whl |
Total release size: 3.9 kB
Release files / env_cleanup_utils-0.1.0.tar.gz
| Download URL | env_cleanup_utils-0.1.0.tar.gz |
|---|---|
| Size | 2.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
60609ecbd8f44c75ada0f73b6e7c33ee27ae93e027a15949f1cc3b961eee2af4
|
|
BLAKE2b-256 checksum How to use checksums |
9fe4758b14e569efd69344a0085b24bf1e6d2cf950fc256cc0cb9054e612503f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.10.6 Windows/10
|
Release files / env_cleanup_utils-0.1.0-py3-none-any.whl
| Download URL | env_cleanup_utils-0.1.0-py3-none-any.whl |
|---|---|
| Size | 2.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
90facbbf3b84af52179c3e30c472e7c07a0bd2317b3c6d0980595e2098ec3174
|
|
BLAKE2b-256 checksum How to use checksums |
f212a0daf5c137f0cb61d1fa8c177f75140d8cdba3d5683c3d94d58207c29c46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.10.6 Windows/10
|
Security for env-cleanup-utils 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.