cleanpy


Namecleanpy JSON
Version 0.5.0 PyPI version JSON
download
home_pagehttps://github.com/thombashi/cleanpy
Summarycleanpy is a CLI tool to remove caches and temporary files that related to Python.
upload_time2024-04-07 09:33:32
maintainerNone
docs_urlNone
authorTsuyoshi Hombashi
requires_python>=3.7
licenseMIT License
keywords cleaner command
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. contents:: **cleanpy**
   :backlinks: top
   :depth: 2

Introduction
============================================
``cleanpy`` is a CLI tool to remove caches and temporary files related to Python.

|PyPI pkg ver| |CI status| |CodeQL|


Installation
============================================

Installation: pip
--------------------------------------------
::

    pip install cleanpy

|Supported Python versions| |Supported Python implementations|

Installation: snap
--------------------------------------------
::

    sudo snap install cleanpy

.. image:: https://snapcraft.io//cleanpy/badge.svg
    :target: https://snapcraft.io/cleanpy
    :alt: snapcraft status


Usage
============================================
::

    cleanpy DIR_PATH [DIR_PATH ...]

``cleanpy`` will remove cache files and temporary files under the ``DIR_PATH``.

Removing files or directories targets are as follows:

- Files to be deleted:
    - ``*.pyc``
    - ``*.pyo``

- Directories to be deleted:
    - ``__pycache__``
    - ``.cache``
    - ``.mypy_cache``
    - ``.pytest_cache``
    - ``.ruff_cache``

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

- ``--include-builds``:
    - ``build`` directory
    - ``dist`` directory
    - ``docs/_build`` directory: ``[sphinx]``
    - ``*.manifest`` files: ``[pyinstaller]``
    - ``*.spec`` files: ``[pyinstaller]``
- ``--include-envs``:
    - ``.venv`` directory
    - ``.nox`` directory
    - ``.tox`` directory
- ``--include-metadata``:
    - ``.eggs`` directory
    - ``*.egg-info`` directories
    - ``.pyre`` directory
    - ``.pytype`` directory
    - ``pip-wheel-metadata`` directory
- ``--include-testing``:
    - ``.coverage`` file
    - ``coverage.xml`` file
    - ``nosetests.xml`` file

All the above options are specified if you use the ``--all`` option.

The following directories are always excluded from the remove:

- ``.git``
- ``.hg``
- ``.svn``
- ``node_modules``

Execution example
--------------------------------------------

Clean the current directory except for virtual environments:

::

    cleanpy --all --exclude-envs .

Command help
--------------------------------------------
::

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

    cleanpy will remove cache files and temporary files under the DIR_PATH.

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

    positional arguments:
      DIR_PATH            path to a root directory to search.

    options:
      -h, --help          show this help message and exit
      -V, --version       show program's version number and exit
      --list              print target directories/files. this does not actually remove directories/files.
      --follow-symlinks   follow symlinks.
      --dry-run           do no harm.
      -i, --interactive   prompt on each file/directory delete.
      -f, --force         delete file/directory without prompt.
      -v, --verbose       shows the verbose output.
      --debug             for debug print.
      --quiet             suppress execution log messages.

    Remove Target:
      -a, --all           remove all of the caches and temporary files.
      --include-builds    remove files/directories that are related to build: build, dist, docs/_build
      --include-envs      remove virtual environment caches.
      --include-metadata  remove metadata.
      --include-testing   remove test results and coverage files.
      --exclude PATTERN   a regular expression for files and directories to be excluded from the removes.
      --exclude-envs      exclude virtual environments from deletion.

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


Dependencies
============================================
Python 3.7+

- no external package dependencies
- platform independent


.. |PyPI pkg ver| image:: https://badge.fury.io/py/cleanpy.svg
    :target: https://badge.fury.io/py/cleanpy
    :alt: PyPI package version

.. |CI status| image:: https://github.com/thombashi/cleanpy/actions/workflows/ci.yml/badge.svg
    :target: https://github.com/thombashi/cleanpy/actions/workflows/ci.yml
    :alt: CI status of Linux/macOS/Windows

.. |CodeQL| image:: https://github.com/thombashi/cleanpy/actions/workflows/github-code-scanning/codeql/badge.svg
    :target: https://github.com/thombashi/cleanpy/actions/workflows/github-code-scanning/codeql
    :alt: CodeQL

.. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/cleanpy.svg
    :target: https://pypi.org/project/cleanpy
    :alt: Supported Python versions

.. |Supported Python implementations| image:: https://img.shields.io/pypi/implementation/cleanpy.svg
    :target: https://pypi.org/project/cleanpy
    :alt: Supported Python implementations

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/thombashi/cleanpy",
    "name": "cleanpy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "cleaner, command",
    "author": "Tsuyoshi Hombashi",
    "author_email": "tsuyoshi.hombashi@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/43/77/da13eece913a0d728bc6736884e00365263e4538327a4cfa2be51b708a7d/cleanpy-0.5.0.tar.gz",
    "platform": null,
    "description": ".. contents:: **cleanpy**\n   :backlinks: top\n   :depth: 2\n\nIntroduction\n============================================\n``cleanpy`` is a CLI tool to remove caches and temporary files related to Python.\n\n|PyPI pkg ver| |CI status| |CodeQL|\n\n\nInstallation\n============================================\n\nInstallation: pip\n--------------------------------------------\n::\n\n    pip install cleanpy\n\n|Supported Python versions| |Supported Python implementations|\n\nInstallation: snap\n--------------------------------------------\n::\n\n    sudo snap install cleanpy\n\n.. image:: https://snapcraft.io//cleanpy/badge.svg\n    :target: https://snapcraft.io/cleanpy\n    :alt: snapcraft status\n\n\nUsage\n============================================\n::\n\n    cleanpy DIR_PATH [DIR_PATH ...]\n\n``cleanpy`` will remove cache files and temporary files under the ``DIR_PATH``.\n\nRemoving files or directories targets are as follows:\n\n- Files to be deleted:\n    - ``*.pyc``\n    - ``*.pyo``\n\n- Directories to be deleted:\n    - ``__pycache__``\n    - ``.cache``\n    - ``.mypy_cache``\n    - ``.pytest_cache``\n    - ``.ruff_cache``\n\nYou can also remove additional files/directories if the following options are specified:\n\n- ``--include-builds``:\n    - ``build`` directory\n    - ``dist`` directory\n    - ``docs/_build`` directory: ``[sphinx]``\n    - ``*.manifest`` files: ``[pyinstaller]``\n    - ``*.spec`` files: ``[pyinstaller]``\n- ``--include-envs``:\n    - ``.venv`` directory\n    - ``.nox`` directory\n    - ``.tox`` directory\n- ``--include-metadata``:\n    - ``.eggs`` directory\n    - ``*.egg-info`` directories\n    - ``.pyre`` directory\n    - ``.pytype`` directory\n    - ``pip-wheel-metadata`` directory\n- ``--include-testing``:\n    - ``.coverage`` file\n    - ``coverage.xml`` file\n    - ``nosetests.xml`` file\n\nAll the above options are specified if you use the ``--all`` option.\n\nThe following directories are always excluded from the remove:\n\n- ``.git``\n- ``.hg``\n- ``.svn``\n- ``node_modules``\n\nExecution example\n--------------------------------------------\n\nClean the current directory except for virtual environments:\n\n::\n\n    cleanpy --all --exclude-envs .\n\nCommand help\n--------------------------------------------\n::\n\n    usage: cleanpy [-h] [-V] [--list] [--follow-symlinks] [--dry-run] [-a] [--include-builds] [--include-envs] [--include-metadata] [--include-testing] [--exclude PATTERN] [--exclude-envs] [-i | -f] [-v | --debug | --quiet] DIR_PATH [DIR_PATH ...]\n\n    cleanpy will remove cache files and temporary files under the DIR_PATH.\n\n    Skip directories from recursive search: .git, .hg, .svn, node_modules\n\n    positional arguments:\n      DIR_PATH            path to a root directory to search.\n\n    options:\n      -h, --help          show this help message and exit\n      -V, --version       show program's version number and exit\n      --list              print target directories/files. this does not actually remove directories/files.\n      --follow-symlinks   follow symlinks.\n      --dry-run           do no harm.\n      -i, --interactive   prompt on each file/directory delete.\n      -f, --force         delete file/directory without prompt.\n      -v, --verbose       shows the verbose output.\n      --debug             for debug print.\n      --quiet             suppress execution log messages.\n\n    Remove Target:\n      -a, --all           remove all of the caches and temporary files.\n      --include-builds    remove files/directories that are related to build: build, dist, docs/_build\n      --include-envs      remove virtual environment caches.\n      --include-metadata  remove metadata.\n      --include-testing   remove test results and coverage files.\n      --exclude PATTERN   a regular expression for files and directories to be excluded from the removes.\n      --exclude-envs      exclude virtual environments from deletion.\n\n    Issue tracker: https://github.com/thombashi/cleanpy/issues\n\n\nDependencies\n============================================\nPython 3.7+\n\n- no external package dependencies\n- platform independent\n\n\n.. |PyPI pkg ver| image:: https://badge.fury.io/py/cleanpy.svg\n    :target: https://badge.fury.io/py/cleanpy\n    :alt: PyPI package version\n\n.. |CI status| image:: https://github.com/thombashi/cleanpy/actions/workflows/ci.yml/badge.svg\n    :target: https://github.com/thombashi/cleanpy/actions/workflows/ci.yml\n    :alt: CI status of Linux/macOS/Windows\n\n.. |CodeQL| image:: https://github.com/thombashi/cleanpy/actions/workflows/github-code-scanning/codeql/badge.svg\n    :target: https://github.com/thombashi/cleanpy/actions/workflows/github-code-scanning/codeql\n    :alt: CodeQL\n\n.. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/cleanpy.svg\n    :target: https://pypi.org/project/cleanpy\n    :alt: Supported Python versions\n\n.. |Supported Python implementations| image:: https://img.shields.io/pypi/implementation/cleanpy.svg\n    :target: https://pypi.org/project/cleanpy\n    :alt: Supported Python implementations\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "cleanpy is a CLI tool to remove caches and temporary files that related to Python.",
    "version": "0.5.0",
    "project_urls": {
        "Changlog": "https://github.com/thombashi/cleanpy/releases",
        "Homepage": "https://github.com/thombashi/cleanpy",
        "Source": "https://github.com/thombashi/cleanpy",
        "Tracker": "https://github.com/thombashi/cleanpy/issues"
    },
    "split_keywords": [
        "cleaner",
        " command"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f8534976b3cc79ba0f43dbd26a640ba65ebb81f222ca5fa544b24487b494b0b7",
                "md5": "0f49b3887a1f63cadea32078d3541060",
                "sha256": "061c3c0ec1d44a89151298257ff0217be33f92be890a5a04088e04a22ff1fb69"
            },
            "downloads": -1,
            "filename": "cleanpy-0.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0f49b3887a1f63cadea32078d3541060",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 9782,
            "upload_time": "2024-04-07T09:33:30",
            "upload_time_iso_8601": "2024-04-07T09:33:30.713606Z",
            "url": "https://files.pythonhosted.org/packages/f8/53/4976b3cc79ba0f43dbd26a640ba65ebb81f222ca5fa544b24487b494b0b7/cleanpy-0.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4377da13eece913a0d728bc6736884e00365263e4538327a4cfa2be51b708a7d",
                "md5": "cd6e91c7d6bb9bcc08cf194f6d3cae0e",
                "sha256": "58a54c909b2626a5b54efaff8b6416130ebef57fbe225ac4b411d3507c327c65"
            },
            "downloads": -1,
            "filename": "cleanpy-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "cd6e91c7d6bb9bcc08cf194f6d3cae0e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 11981,
            "upload_time": "2024-04-07T09:33:32",
            "upload_time_iso_8601": "2024-04-07T09:33:32.372034Z",
            "url": "https://files.pythonhosted.org/packages/43/77/da13eece913a0d728bc6736884e00365263e4538327a4cfa2be51b708a7d/cleanpy-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-07 09:33:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "thombashi",
    "github_project": "cleanpy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "cleanpy"
}
        
Elapsed time: 1.46811s