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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file cleaner-project-1.0.1.tar.gz.

File metadata

  • Download URL: cleaner-project-1.0.1.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for cleaner-project-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7169114877a73450631fd37f9721c16e1de26e2451949f4ee4d1e6a8b0fc5c3c
MD5 ae9350bb56b520d8328f5fac7505b583
BLAKE2b-256 511bd29dcde5b4ec7ce928b630c04f75f7f9034e9436bdd501ae3cdebaf15ae6

See more details on using hashes here.

File details

Details for the file cleaner_project-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cleaner_project-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 10ba82c908fbedecc6e5d20da35f5a5467b61f2ad286c7fe696cad9e11814036
MD5 980720425587dc064a8209b6f1357531
BLAKE2b-256 5a07031f48067d77a4e799fd57a725eec0703bb966a012f6ed4912b633ee6a7c

See more details on using hashes here.

Supported by

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