Skip to main content

cleanpy is a CLI command to remove cache files and temporary files that related to Python.

Project description

Summary

cleanpy is a CLI command to remove cache files and temporary files that related to Python.

PyPI package version Supported Python versions Supported Python implementations Linux/macOS CI status

Installation

Installation: pip

pip install cleanpy

Installation: snap

sudo snap install cleanpy
snapcraft status

Usage

cleanpy DIR_PATH [DIR_PATH ...]

cleanpy will remove cache files and temporaly files under the DIR_PATH

Remove files/directories are as follows:

  • files:
    • *.pyc

    • *.pyo

  • directories:
    • __pycache__

    • .cache

    • .mypy_cache

    • .pytest_cache

You can also remove additional files/directories if the following options are specified:

  • --include-builds:
    • build

    • dist

    • docs/_build: sphinx

    • *.manifest: pyinstaller

    • *.spec: pyinstaller

  • --include-envs:
    • .nox

    • .tox

    • .venv

  • --include-metadata:
    • .eggs

    • *.egg-info

    • pip-wheel-metadata

    • .pyre

    • .pytype

  • --include-tests:
    • .coverage

    • coverage.xml

    • nosetests.xml

All of the above options are specified if set the --all option to the command.

Following directories are excluded from the search:

  • .git

  • .hg

  • .svn

  • node_modules

Execution example

$ cleanpy -av .
[INFO] remove directory [cache - Python]: ./test/__pycache__
[INFO] remove directory [cache - pytest]: ./.pytest_cache
[INFO] remove directory [env - virtual env]: ./.tox
[INFO] remove directory [build - Python]: ./dist
[INFO] remove directory [cache - mypy]: ./.mypy_cache
[INFO] remove directory [metadata - type checker]: ./.pytype
[INFO] remove directory [build - Python]: ./build
[INFO] remove directory [metadata - Python]: ./cleanpy.egg-info
[INFO] removed 8 directories

Command help

usage: cleanpy [-h] [-V] [--follow-symlinks] [--dry-run] [-a]
            [--include-builds] [--include-envs] [--include-metadata]
            [--include-tests] [--exclude PATTERN] [-v | --debug | --quiet]
            DIR_PATH [DIR_PATH ...]

Remove cache files and temporary files that related to Python.

Skip directories from recursive search: .git, .hg, .svn, node_modules

positional arguments:
DIR_PATH            path to a root directory to search

optional arguments:
-h, --help          show this help message and exit
-V, --version       show program's version number and exit
--follow-symlinks   follow symlinks
--dry-run           do no harm.
-v, --verbose       shows verbose output.
--debug             for debug print.
--quiet             suppress execution log messages.

Remove Target:
-a, --all           remove all of the caches and teporary fils.
--include-builds    remove files/directories that related build: build,
                    dist, docs/_build
--include-envs      remove virtual environments.
--include-metadata  remove metadata.
--include-tests     remove test results and coverage files.
--exclude PATTERN   a regular expression that matches files and directories
                    that should be excluded on recursive searches.

Issue tracker: https://github.com/thombashi/cleanpy/issues

Dependencies

Python 3.6+

  • no external package dependencies

  • platform independent

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

cleanpy-0.0.5.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

cleanpy-0.0.5-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file cleanpy-0.0.5.tar.gz.

File metadata

  • Download URL: cleanpy-0.0.5.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for cleanpy-0.0.5.tar.gz
Algorithm Hash digest
SHA256 b5d4044ae22709c14b9c33d980cd8f7d49016625097dce23b6ba1800c2055a17
MD5 d80c31ff95d015f7bb72d1bb5e12999e
BLAKE2b-256 8ac13f4e6f10979f2838671e1eb519687c20a53d2dcfd1833a5c8e4404f46c67

See more details on using hashes here.

File details

Details for the file cleanpy-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: cleanpy-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for cleanpy-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 702b6765733afa83af4b3395c22b9b132f7fa09dd1166de1274afb44eb147b9c
MD5 0a59168c04042a2a029d84a53178ebb5
BLAKE2b-256 e7b144bc4267784627d33c5365defd013c505d0c4bd3b3c04b76450b778ce241

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