Skip to main content

Partitions the project w.r.t. its core files to libraries and scripts (that is, those files that do not directly relate to the project core files). The latter can be removed with a dedicated API call and its options.

Project description

PyCleaner

PyCleaner is a simple Python library that helps you to keep the repository clean by finding all redundant py-files there. It is especially helpful when you incorporate someone else's repositories, your project is growing huge, and at some point, you need to get rid of the Python scripts you don't use.

PyCleaner scans the project folder for dependencies of the core project files (target). After exploring the project directory, it provides stats about modules directly or indirectly imported in the target files. These modules are referred to (in the context of this package) as libraries. The rest files whose names were not found during recursive search of the import statements of the core files are named scripts. While the removal of scripts is possible by design, a user should prefer manual deletion after more thorough inspection.

Usage

Install with pip

pip install pycleaner

Get stats about the core file dependencies

pycleaner --project <proj_dir> --target <dir_w/_project_core_files>

Remove those files on which the core file do not depend

pycleaner --project <proj_dir> --target <dir_w/_project_core_files> --rm-scripts

Learn more about pycleaner's options

pycleaner --help

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

cleaner-project-1.0.1.tar.gz (7.2 kB view hashes)

Uploaded Source

Built Distribution

cleaner_project-1.0.1-py3-none-any.whl (21.7 MB view hashes)

Uploaded Python 3

Supported by

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