cleanpy


Namecleanpy JSON
Version 0.5.1 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-12-30 06:08:15
maintainerNone
docs_urlNone
authorTsuyoshi Hombashi
requires_python>=3.9
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 implementations| |Supported Python versions|

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           don't actually do anything.
      -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.9+

- 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.9",
    "maintainer_email": null,
    "keywords": "cleaner, command",
    "author": "Tsuyoshi Hombashi",
    "author_email": "tsuyoshi.hombashi@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/da/94/c10e463f720c804c55cb4b3c5f04380fa03e9b1e2fb7026420528fd89476/cleanpy-0.5.1.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 implementations| |Supported Python versions|\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 |\n                   --debug | --quiet]\n                   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           don't actually do anything.\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.9+\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.1",
    "project_urls": {
        "Changelog": "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": "c161cfd606e2425a7490982cdfa5c8da86f35b158eba792f5f9107a1788a2ad7",
                "md5": "f1367402e17e4ff2e907288de8b98aa0",
                "sha256": "c60589d5da68527ca0c9151e28ed56fffae69df4ab6c9bfd8c1cf1d9e76a09b8"
            },
            "downloads": -1,
            "filename": "cleanpy-0.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f1367402e17e4ff2e907288de8b98aa0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 9823,
            "upload_time": "2024-12-30T06:08:12",
            "upload_time_iso_8601": "2024-12-30T06:08:12.107696Z",
            "url": "https://files.pythonhosted.org/packages/c1/61/cfd606e2425a7490982cdfa5c8da86f35b158eba792f5f9107a1788a2ad7/cleanpy-0.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "da94c10e463f720c804c55cb4b3c5f04380fa03e9b1e2fb7026420528fd89476",
                "md5": "6777186f7978001465e0ae74b4a17a5f",
                "sha256": "9ddfa7ce80dd888b597a8b0bfeea3b69567839b6f41b775a4f76f46914d5170e"
            },
            "downloads": -1,
            "filename": "cleanpy-0.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "6777186f7978001465e0ae74b4a17a5f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 11985,
            "upload_time": "2024-12-30T06:08:15",
            "upload_time_iso_8601": "2024-12-30T06:08:15.068707Z",
            "url": "https://files.pythonhosted.org/packages/da/94/c10e463f720c804c55cb4b3c5f04380fa03e9b1e2fb7026420528fd89476/cleanpy-0.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-30 06:08:15",
    "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: 0.47169s