# pycociC - A Python library for removing pycache and numba cache files
## Installation
> pip install [pycociC](https://pypi.org/project/pycociC/)
## Usage
> python **-B** -m pycociC [-t DIRS [DIRS ...]] [-h]
```
options:
-h, --help show this help message and exit
-t DIRS [DIRS ...], -d DIRS [DIRS ...], --dirs DIRS [DIRS ...]
Directories to search for pycache files (default: (everywhere))
```
## Coding
```python
# pycociC/__init__.py
__all__ = ('FP_RE', 'bytes_to_pretty_view', 'eat_cache', 'dont_write_bytecode')
FP_RE = re.compile(r'.*\.py([co]|.*\.nb[ci])', re.I)
def eat_cache(at_dirs: Iterable[AnyStr, os.PathLike[AnyStr]] = ('.',)):
"""Function removes files matching the regular expression (see FP_RE) from all "__pycache__" folders recursively."""
...
def bytes_to_pretty_view(bytes_size: int = 0) -> str:
"""
Converts the number of bytes into a pretty SI prefix.
>>> bytes_to_pretty_view(0)
'0B'
>>> bytes_to_pretty_view(1_000_000_24)
'100MB 24B'
>>> bytes_to_pretty_view(0xFF_FF_FF_FF)
'4GB 294MB 967kB 295B'
"""
...
```
### Example Output
> python -m pycociC -d .
```
WARNING:root:pycociC doesn't remove bytecode files.
You can use "-B" option of python or PYTHONDONTWRITEBYTECODE=x to do so.
Starting for .
pycociC\__pycache__
__init__.cpython-310.pyc (4kB 699B)
__main__.cpython-310.pyc (1kB 153B)
pycociC\__pycache__ # only if the folder has been deleted
venv\Lib\site-packages\_distutils_hack\__pycache__
__init__.cpython-310.pyc (7kB 593B)
venv\Lib\site-packages\_distutils_hack\__pycache__
venv\Lib\site-packages\__pycache__
_virtualenv.cpython-310.pyc (4kB 107B)
venv\Lib\site-packages\__pycache__
Removed 17kB 552B
```
> python -B -m pycociC
```
Starting for C:\, D:\
C:\...\Python310\Lib\collections\__pycache__
abc.cpython-310.pyc (251B)
__init__.cpython-310.pyc (48kB 468B)
C:\...\Python310\Lib\collections\__pycache__
C:\...\Python310\Lib\importlib\__pycache__
abc.cpython-310.pyc (15kB 904B)
...
__init__.cpython-310.pyc (3kB 818B)
C:\...\Python310\Lib\importlib\__pycache__
C:\...\Python310\Lib\urllib\__pycache__
parse.cpython-310.pyc (33kB 817B)
__init__.cpython-310.pyc (144B)
C:\...\Python310\Lib\urllib\__pycache__
...
D:\...\venv\Lib\site-packages\_distutils_hack\__pycache__
__init__.cpython-310.pyc (7kB 593B)
D:\...\venv\Lib\site-packages\_distutils_hack\__pycache__
D:\...\venv\Lib\site-packages\__pycache__
_virtualenv.cpython-310.pyc (4kB 107B)
D:\...\venv\Lib\site-packages\__pycache__
Removed 1MB 481kB 138B
```
Raw data
{
"_id": null,
"home_page": "https://github.com/NIKDISSV-Forever/pycociC",
"name": "pycociC",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "",
"author": "Nikita (NIKDISSV)",
"author_email": "nikdissv@proton.me",
"download_url": "https://files.pythonhosted.org/packages/63/80/f59d618908c95ae8fb181edfdb23e88ea9eece2dd4c11c9c25045ad52ad2/pycociC-1.1.2.tar.gz",
"platform": null,
"description": "# pycociC - A Python library for removing pycache and numba cache files\r\n\r\n## Installation\r\n\r\n> pip install [pycociC](https://pypi.org/project/pycociC/)\r\n\r\n## Usage\r\n\r\n> python **-B** -m pycociC [-t DIRS [DIRS ...]] [-h]\r\n\r\n```\r\noptions:\r\n -h, --help show this help message and exit\r\n -t DIRS [DIRS ...], -d DIRS [DIRS ...], --dirs DIRS [DIRS ...]\r\n Directories to search for pycache files (default: (everywhere))\r\n```\r\n\r\n## Coding\r\n\r\n```python\r\n# pycociC/__init__.py\r\n__all__ = ('FP_RE', 'bytes_to_pretty_view', 'eat_cache', 'dont_write_bytecode')\r\nFP_RE = re.compile(r'.*\\.py([co]|.*\\.nb[ci])', re.I)\r\n\r\n\r\ndef eat_cache(at_dirs: Iterable[AnyStr, os.PathLike[AnyStr]] = ('.',)):\r\n \"\"\"Function removes files matching the regular expression (see FP_RE) from all \"__pycache__\" folders recursively.\"\"\"\r\n ...\r\n\r\n\r\ndef bytes_to_pretty_view(bytes_size: int = 0) -> str:\r\n \"\"\"\r\n Converts the number of bytes into a pretty SI prefix.\r\n\r\n >>> bytes_to_pretty_view(0)\r\n '0B'\r\n >>> bytes_to_pretty_view(1_000_000_24)\r\n '100MB 24B'\r\n >>> bytes_to_pretty_view(0xFF_FF_FF_FF)\r\n '4GB 294MB 967kB 295B'\r\n \"\"\"\r\n ...\r\n\r\n```\r\n\r\n### Example Output\r\n\r\n> python -m pycociC -d .\r\n\r\n```\r\nWARNING:root:pycociC doesn't remove bytecode files.\r\n You can use \"-B\" option of python or PYTHONDONTWRITEBYTECODE=x to do so.\r\n\r\n\r\nStarting for .\r\n\r\n\r\npycociC\\__pycache__\r\n __init__.cpython-310.pyc (4kB 699B)\r\n __main__.cpython-310.pyc (1kB 153B)\r\npycociC\\__pycache__ # only if the folder has been deleted\r\n\r\nvenv\\Lib\\site-packages\\_distutils_hack\\__pycache__\r\n __init__.cpython-310.pyc (7kB 593B)\r\nvenv\\Lib\\site-packages\\_distutils_hack\\__pycache__\r\n\r\nvenv\\Lib\\site-packages\\__pycache__\r\n _virtualenv.cpython-310.pyc (4kB 107B)\r\nvenv\\Lib\\site-packages\\__pycache__\r\n\r\n\r\nRemoved 17kB 552B\r\n```\r\n\r\n> python -B -m pycociC\r\n\r\n```\r\nStarting for C:\\, D:\\\r\n\r\n\r\nC:\\...\\Python310\\Lib\\collections\\__pycache__\r\n abc.cpython-310.pyc (251B)\r\n __init__.cpython-310.pyc (48kB 468B)\r\nC:\\...\\Python310\\Lib\\collections\\__pycache__\r\n\r\nC:\\...\\Python310\\Lib\\importlib\\__pycache__ \r\n abc.cpython-310.pyc (15kB 904B)\r\n ...\r\n __init__.cpython-310.pyc (3kB 818B)\r\nC:\\...\\Python310\\Lib\\importlib\\__pycache__ \r\n\r\nC:\\...\\Python310\\Lib\\urllib\\__pycache__\r\n parse.cpython-310.pyc (33kB 817B)\r\n __init__.cpython-310.pyc (144B)\r\nC:\\...\\Python310\\Lib\\urllib\\__pycache__\r\n\r\n ...\r\n\r\nD:\\...\\venv\\Lib\\site-packages\\_distutils_hack\\__pycache__\r\n __init__.cpython-310.pyc (7kB 593B)\r\nD:\\...\\venv\\Lib\\site-packages\\_distutils_hack\\__pycache__\r\n\r\nD:\\...\\venv\\Lib\\site-packages\\__pycache__\r\n _virtualenv.cpython-310.pyc (4kB 107B)\r\nD:\\...\\venv\\Lib\\site-packages\\__pycache__\r\n\r\n\r\nRemoved 1MB 481kB 138B\r\n```\r\n",
"bugtrack_url": null,
"license": "",
"summary": "Remove pycache (and numba cache) files",
"version": "1.1.2",
"project_urls": {
"Homepage": "https://github.com/NIKDISSV-Forever/pycociC"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b51247f43ea312b2c480fb4a4e61f9caaee0215596d3b72d156597f8ad0ad16d",
"md5": "da6ede5a53e683e584fd8d67fe3a2c4e",
"sha256": "7d5c0be62a9b34fab3375b26200be4f82e86e3a1e1cf70cbb97542439dc5f914"
},
"downloads": -1,
"filename": "pycociC-1.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "da6ede5a53e683e584fd8d67fe3a2c4e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 5136,
"upload_time": "2023-05-30T11:38:27",
"upload_time_iso_8601": "2023-05-30T11:38:27.943034Z",
"url": "https://files.pythonhosted.org/packages/b5/12/47f43ea312b2c480fb4a4e61f9caaee0215596d3b72d156597f8ad0ad16d/pycociC-1.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6380f59d618908c95ae8fb181edfdb23e88ea9eece2dd4c11c9c25045ad52ad2",
"md5": "91cf5b93fcce1031ff34a524120e8b15",
"sha256": "29988ce1e062d584587c8561899597288910a0478d89a22dbbc408f96d613e70"
},
"downloads": -1,
"filename": "pycociC-1.1.2.tar.gz",
"has_sig": false,
"md5_digest": "91cf5b93fcce1031ff34a524120e8b15",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 4404,
"upload_time": "2023-05-30T11:38:30",
"upload_time_iso_8601": "2023-05-30T11:38:30.073685Z",
"url": "https://files.pythonhosted.org/packages/63/80/f59d618908c95ae8fb181edfdb23e88ea9eece2dd4c11c9c25045ad52ad2/pycociC-1.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-30 11:38:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "NIKDISSV-Forever",
"github_project": "pycociC",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "pycocic"
}