cachekaro 2.1.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. cachekaro-2.1.7/LICENSE +21 -0
  2. cachekaro-2.1.7/PKG-INFO +397 -0
  3. cachekaro-2.1.7/README.md +353 -0
  4. cachekaro-2.1.7/cachekaro/__init__.py +20 -0
  5. cachekaro-2.1.7/cachekaro/__main__.py +11 -0
  6. cachekaro-2.1.7/cachekaro/cli.py +785 -0
  7. cachekaro-2.1.7/cachekaro/config/__init__.py +12 -0
  8. cachekaro-2.1.7/cachekaro/config/default.py +214 -0
  9. cachekaro-2.1.7/cachekaro/config/paths/__init__.py +3 -0
  10. cachekaro-2.1.7/cachekaro/core/__init__.py +15 -0
  11. cachekaro-2.1.7/cachekaro/core/analyzer.py +333 -0
  12. cachekaro-2.1.7/cachekaro/core/cleaner.py +418 -0
  13. cachekaro-2.1.7/cachekaro/core/scanner.py +343 -0
  14. cachekaro-2.1.7/cachekaro/exporters/__init__.py +53 -0
  15. cachekaro-2.1.7/cachekaro/exporters/base.py +105 -0
  16. cachekaro-2.1.7/cachekaro/exporters/csv_export.py +142 -0
  17. cachekaro-2.1.7/cachekaro/exporters/html_export.py +681 -0
  18. cachekaro-2.1.7/cachekaro/exporters/json_export.py +93 -0
  19. cachekaro-2.1.7/cachekaro/exporters/text.py +181 -0
  20. cachekaro-2.1.7/cachekaro/models/__init__.py +17 -0
  21. cachekaro-2.1.7/cachekaro/models/cache_item.py +225 -0
  22. cachekaro-2.1.7/cachekaro/models/scan_result.py +274 -0
  23. cachekaro-2.1.7/cachekaro/platforms/__init__.py +16 -0
  24. cachekaro-2.1.7/cachekaro/platforms/base.py +591 -0
  25. cachekaro-2.1.7/cachekaro/platforms/detector.py +119 -0
  26. cachekaro-2.1.7/cachekaro/platforms/linux.py +474 -0
  27. cachekaro-2.1.7/cachekaro/platforms/macos.py +391 -0
  28. cachekaro-2.1.7/cachekaro/platforms/windows.py +636 -0
  29. cachekaro-2.1.7/cachekaro/utils/__init__.py +15 -0
  30. cachekaro-2.1.7/cachekaro/utils/colors.py +174 -0
  31. cachekaro-2.1.7/cachekaro/utils/formatting.py +190 -0
  32. cachekaro-2.1.7/cachekaro.egg-info/PKG-INFO +397 -0
  33. cachekaro-2.1.7/cachekaro.egg-info/SOURCES.txt +41 -0
  34. cachekaro-2.1.7/cachekaro.egg-info/dependency_links.txt +1 -0
  35. cachekaro-2.1.7/cachekaro.egg-info/entry_points.txt +2 -0
  36. cachekaro-2.1.7/cachekaro.egg-info/requires.txt +12 -0
  37. cachekaro-2.1.7/cachekaro.egg-info/top_level.txt +1 -0
  38. cachekaro-2.1.7/pyproject.toml +126 -0
  39. cachekaro-2.1.7/setup.cfg +4 -0
  40. cachekaro-2.1.7/tests/test_analyzer.py +133 -0
  41. cachekaro-2.1.7/tests/test_cleaner.py +134 -0
  42. cachekaro-2.1.7/tests/test_exporters.py +167 -0
  43. cachekaro-2.1.7/tests/test_platforms.py +137 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Mohit Bagri
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,397 @@
1
+ Metadata-Version: 2.4
2
+ Name: cachekaro
3
+ Version: 2.1.7
4
+ Summary: Cross-platform storage and cache analyzer & cleaner - Cache Karo!
5
+ Author-email: MOHIT BAGRI <mailmohitbagri@gmail.com>
6
+ Maintainer-email: MOHIT BAGRI <mailmohitbagri@gmail.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/Mohit-Bagri/cachekaro
9
+ Project-URL: Documentation, https://github.com/Mohit-Bagri/cachekaro#readme
10
+ Project-URL: Repository, https://github.com/Mohit-Bagri/cachekaro.git
11
+ Project-URL: Issues, https://github.com/Mohit-Bagri/cachekaro/issues
12
+ Project-URL: Changelog, https://github.com/Mohit-Bagri/cachekaro/blob/main/CHANGELOG.md
13
+ Keywords: cache,storage,cleanup,disk-space,system-maintenance,cross-platform,macos,linux,windows
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Intended Audience :: System Administrators
18
+ Classifier: Intended Audience :: End Users/Desktop
19
+ Classifier: Operating System :: OS Independent
20
+ Classifier: Operating System :: MacOS :: MacOS X
21
+ Classifier: Operating System :: POSIX :: Linux
22
+ Classifier: Operating System :: Microsoft :: Windows
23
+ Classifier: Programming Language :: Python :: 3
24
+ Classifier: Programming Language :: Python :: 3.9
25
+ Classifier: Programming Language :: Python :: 3.10
26
+ Classifier: Programming Language :: Python :: 3.11
27
+ Classifier: Programming Language :: Python :: 3.12
28
+ Classifier: Topic :: System :: Systems Administration
29
+ Classifier: Topic :: Utilities
30
+ Requires-Python: >=3.9
31
+ Description-Content-Type: text/markdown
32
+ License-File: LICENSE
33
+ Requires-Dist: pyyaml>=6.0
34
+ Requires-Dist: colorama>=0.4.6
35
+ Provides-Extra: dev
36
+ Requires-Dist: pytest>=7.0; extra == "dev"
37
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
38
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
39
+ Requires-Dist: mypy>=1.0; extra == "dev"
40
+ Requires-Dist: types-PyYAML>=6.0; extra == "dev"
41
+ Provides-Extra: rich
42
+ Requires-Dist: rich>=13.0; extra == "rich"
43
+ Dynamic: license-file
44
+
45
+ <div align="center">
46
+
47
+ # **CacheKaro**
48
+
49
+ ### Cross-Platform Storage & Cache Manager
50
+
51
+ **CacheKaro** - *Clean It Up!*
52
+
53
+ [![Python](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
54
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
55
+ [![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-lightgrey.svg)](#-platform-support)
56
+ [![Tests](https://img.shields.io/badge/tests-53%20passing-brightgreen.svg)](#-development)
57
+
58
+ [Overview](#-overview) · [Installation](#-installation) · [Uninstall](#-uninstall) · [Quick Start](#-quick-start) · [Commands](#-commands) · [Detection](#-what-it-detects) · [Safety](#-safety--risk-levels) · [Export Formats](#-export-formats) · [Config](#-configuration) · [Development](#-development) · [Platform Support](#-platform-support) · [License](#-license)
59
+
60
+ </div>
61
+
62
+ ---
63
+
64
+ ## ▸ Overview
65
+
66
+ **CacheKaro** is a cross-platform CLI tool to analyze and clean cache/storage on **macOS**, **Linux** and **Windows**. It automatically discovers caches from all installed applications and games.
67
+
68
+ ### Why CacheKaro?
69
+
70
+ | # | Feature | Description |
71
+ |:-:|---------|-------------|
72
+ | 1 | **Auto-Discovery** | Automatically detects 300+ known apps and any new software you install |
73
+ | 2 | **Cross-Platform** | One tool for macOS, Linux and Windows |
74
+ | 3 | **Developer Friendly** | Cleans npm, pip, Gradle, Maven, Cargo, Go, Docker and more |
75
+ | 4 | **Game Support** | Steam, Epic Games, Riot Games, Battle.net, Minecraft and more |
76
+ | 5 | **Creative Suite** | Adobe CC, DaVinci Resolve, Blender, Ableton, AutoCAD and more |
77
+ | 6 | **Safe by Default** | Risk-based classification prevents accidental data loss |
78
+ | 7 | **Beautiful Reports** | Cyberpunk-themed HTML reports with charts |
79
+
80
+ ---
81
+
82
+ ## ▸ Installation
83
+
84
+ ### • Prerequisites
85
+
86
+ - Python 3.9 or higher
87
+ - pip (Python package manager)
88
+
89
+ ### • Install via pip (Recommended)
90
+
91
+ ```bash
92
+ pip install cachekaro
93
+ ```
94
+
95
+ ### • Install from Source
96
+
97
+ ```bash
98
+ # 1. Clone the repository
99
+ git clone https://github.com/Mohit-Bagri/cachekaro.git
100
+
101
+ # 2. Navigate to the ROOT folder (not cachekaro/cachekaro)
102
+ cd cachekaro
103
+
104
+ # 3. Create and activate virtual environment (recommended)
105
+ python3 -m venv venv
106
+ source venv/bin/activate # macOS/Linux
107
+ # OR
108
+ .\venv\Scripts\activate # Windows
109
+
110
+ # 4. Install CacheKaro
111
+ pip install -e .
112
+ ```
113
+
114
+ ### • Verify Installation
115
+
116
+ ```bash
117
+ cachekaro --version
118
+ ```
119
+
120
+ > **Note:** If installed from source, the `cachekaro` command only works when the virtual environment is activated. Always run `source venv/bin/activate` before using CacheKaro.
121
+
122
+ ### • 🚀 Getting Started (Run These After Install!)
123
+
124
+ ```bash
125
+ # See what's taking up space
126
+ cachekaro analyze
127
+
128
+ # View system info
129
+ cachekaro info
130
+
131
+ # Generate a detailed HTML report
132
+ cachekaro report
133
+
134
+ # Clean caches safely (interactive)
135
+ cachekaro clean
136
+
137
+ # Get help
138
+ cachekaro --help
139
+ ```
140
+
141
+ ---
142
+
143
+ ## ▸ Uninstall
144
+
145
+ ```bash
146
+ pip uninstall cachekaro
147
+ ```
148
+
149
+ To also remove configuration files:
150
+
151
+ | Platform | Command |
152
+ |----------|---------|
153
+ | macOS/Linux | `rm -rf ~/.config/cachekaro` |
154
+ | Windows | `rmdir /s %APPDATA%\cachekaro` |
155
+
156
+ ---
157
+
158
+ ## ▸ Quick Start
159
+
160
+ ```bash
161
+ # ► Analyze your storage
162
+ cachekaro analyze
163
+
164
+ # ► Preview what can be cleaned (safe mode)
165
+ cachekaro clean --dry-run
166
+
167
+ # ► Clean caches interactively
168
+ cachekaro clean
169
+
170
+ # ► Auto-clean all safe items without prompts
171
+ cachekaro clean --auto
172
+
173
+ # ► Generate cyberpunk HTML report
174
+ cachekaro report --output report.html
175
+ ```
176
+
177
+ ---
178
+
179
+ ## ▸ Commands
180
+
181
+ ### • `cachekaro analyze`
182
+
183
+ Scans and displays all cache/storage usage on your system.
184
+
185
+ ```bash
186
+ cachekaro analyze # Basic analysis
187
+ cachekaro analyze -f json # Output as JSON
188
+ cachekaro analyze -f csv -o data.csv # Export to CSV
189
+ cachekaro analyze -c browser # Only browser caches
190
+ cachekaro analyze --min-size 100MB # Only items > 100MB
191
+ cachekaro analyze --stale-days 7 # Mark items older than 7 days as stale
192
+ ```
193
+
194
+ | Option | Short | Description | Default |
195
+ |--------|-------|-------------|---------|
196
+ | `--format` | `-f` | Output format: `text`, `json`, `csv` | `text` |
197
+ | `--output` | `-o` | Save output to file | stdout |
198
+ | `--category` | `-c` | Filter: `browser`, `development`, `game`, `application`, `system` | all |
199
+ | `--min-size` | — | Minimum size filter (e.g., `50MB`, `1GB`) | `0` |
200
+ | `--stale-days` | — | Days threshold for stale detection | `30` |
201
+
202
+ ---
203
+
204
+ ### • `cachekaro clean`
205
+
206
+ Removes cache files based on selected criteria.
207
+
208
+ ```bash
209
+ cachekaro clean # Interactive mode
210
+ cachekaro clean --dry-run # Preview only, no deletion
211
+ cachekaro clean --auto # Auto-clean without prompts
212
+ cachekaro clean --auto --risk moderate # Include moderate risk items
213
+ cachekaro clean -c browser # Clean only browser caches
214
+ cachekaro clean --stale-only # Clean only stale items
215
+ ```
216
+
217
+ | Option | Description | Default |
218
+ |--------|-------------|---------|
219
+ | `--dry-run` | Preview what would be deleted without actually deleting | `false` |
220
+ | `--auto` | Automatically clean all items without confirmation prompts | `false` |
221
+ | `--category` | Category to clean: `browser`, `development`, `game`, `application`, `system` | all |
222
+ | `--risk` | Maximum risk level: `safe`, `moderate`, `caution` | `safe` |
223
+ | `--stale-only` | Only clean items older than stale threshold | `false` |
224
+
225
+ ---
226
+
227
+ ### • `cachekaro report`
228
+
229
+ Generates detailed visual reports with charts.
230
+
231
+ ```bash
232
+ cachekaro report # Generate HTML report
233
+ cachekaro report -o myreport.html # Custom filename
234
+ cachekaro report -f json -o report.json # JSON format
235
+ ```
236
+
237
+ | Option | Short | Description | Default |
238
+ |--------|-------|-------------|---------|
239
+ | `--format` | `-f` | Report format: `html`, `json`, `csv`, `text` | `html` |
240
+ | `--output` | `-o` | Output file path | `cachekaro_report_<timestamp>.html` |
241
+
242
+ ---
243
+
244
+ ### • `cachekaro info`
245
+
246
+ Displays system information and CacheKaro configuration.
247
+
248
+ ```bash
249
+ cachekaro info
250
+ ```
251
+
252
+ ---
253
+
254
+ ### • `cachekaro update`
255
+
256
+ Check for updates and get upgrade instructions.
257
+
258
+ ```bash
259
+ cachekaro update # Check for new versions
260
+ ```
261
+
262
+ CacheKaro automatically notifies you when a new version is available each time you run a command.
263
+
264
+ ---
265
+
266
+ ## ▸ What It Detects
267
+
268
+ ### • Automatic Discovery
269
+
270
+ CacheKaro automatically scans standard cache directories and identifies **any** application by its folder name. It recognizes 300+ known apps with friendly names.
271
+
272
+ ### • Categories
273
+
274
+ | # | Category | Examples |
275
+ |:-:|----------|----------|
276
+ | 1 | **Browser** | Chrome, Firefox, Safari, Edge, Brave, Arc, Vivaldi, Opera |
277
+ | 2 | **Development** | npm, pip, Cargo, Gradle, Maven, Docker, VS Code, JetBrains, Xcode |
278
+ | 3 | **Games** | Steam, Epic Games, Riot Games, Battle.net, Minecraft, Unity, GOG |
279
+ | 4 | **Creative** | Photoshop, Premiere Pro, After Effects, DaVinci Resolve, Final Cut Pro |
280
+ | 5 | **3D & Design** | Blender, Cinema 4D, Maya, ZBrush, SketchUp, Figma, Sketch |
281
+ | 6 | **Audio** | Ableton Live, FL Studio, Logic Pro, Pro Tools, Cubase, GarageBand |
282
+ | 7 | **Engineering** | AutoCAD, SolidWorks, Fusion 360, MATLAB, Simulink, Revit |
283
+ | 8 | **Applications** | Spotify, Discord, Slack, Zoom, WhatsApp, Notion, Obsidian |
284
+ | 9 | **System** | OS caches, temp files, logs, crash reports, font caches |
285
+
286
+ ### • Platform-Specific Paths
287
+
288
+ | Platform | Locations Scanned |
289
+ |----------|-------------------|
290
+ | **macOS** | `~/Library/Caches`, `~/.cache`, `~/Library/Logs`, `~/Library/Application Support` |
291
+ | **Linux** | `~/.cache`, `~/.config`, `~/.local/share`, `~/.steam`, `~/.var/app` |
292
+ | **Windows** | `%LOCALAPPDATA%`, `%APPDATA%`, `%TEMP%`, `%USERPROFILE%` |
293
+
294
+ ---
295
+
296
+ ## ▸ Safety & Risk Levels
297
+
298
+ | Level | Icon | Description | Examples |
299
+ |-------|------|-------------|----------|
300
+ | **Safe** | 🟢 | 100% safe to delete, no data loss | Browser cache, npm cache, pip cache, temp files |
301
+ | **Moderate** | 🟡 | Generally safe, may require re-login or re-download | HuggingFace models, Maven repo, Docker images |
302
+ | **Caution** | 🔴 | Review before deleting, may contain user data | Downloads folder, application data |
303
+
304
+ ```bash
305
+ # ► Only clean safe items (default behavior)
306
+ cachekaro clean --risk safe
307
+
308
+ # ► Include moderate risk items
309
+ cachekaro clean --risk moderate
310
+
311
+ # ► Preview caution-level items before cleaning
312
+ cachekaro clean --risk caution --dry-run
313
+ ```
314
+
315
+ ---
316
+
317
+ ## ▸ Export Formats
318
+
319
+ | # | Format | Use Case | Command Example |
320
+ |:-:|--------|----------|-----------------|
321
+ | 1 | **Text** | Terminal output with colors | `cachekaro analyze` |
322
+ | 2 | **JSON** | APIs and automation | `cachekaro analyze -f json` |
323
+ | 3 | **CSV** | Spreadsheet analysis | `cachekaro analyze -f csv -o data.csv` |
324
+ | 4 | **HTML** | Interactive reports with charts | `cachekaro report` |
325
+
326
+ ---
327
+
328
+ ## ▸ Configuration
329
+
330
+ ### • Config File Location
331
+
332
+ | Platform | Path |
333
+ |----------|------|
334
+ | macOS/Linux | `~/.config/cachekaro/config.yaml` |
335
+ | Windows | `%APPDATA%\cachekaro\config.yaml` |
336
+
337
+ ### • Example Config
338
+
339
+ ```yaml
340
+ settings:
341
+ stale_threshold_days: 30 # Days before item is considered stale
342
+ default_format: text # Default output format
343
+ color_output: true # Enable colored terminal output
344
+ backup_before_delete: false # Create backup before deletion
345
+
346
+ custom_paths: # Add your own cache paths
347
+ - path: ~/my-app/cache
348
+ name: My App Cache
349
+ category: custom
350
+ risk_level: safe
351
+ ```
352
+
353
+ ---
354
+
355
+ ## ▸ Development
356
+
357
+ ```bash
358
+ # ► Setup development environment
359
+ git clone https://github.com/Mohit-Bagri/cachekaro.git
360
+ cd cachekaro
361
+ python3 -m venv venv
362
+ source venv/bin/activate
363
+ pip install -e ".[dev]"
364
+
365
+ # ► Run tests
366
+ pytest
367
+
368
+ # ► Linting & type checking
369
+ ruff check .
370
+ mypy cachekaro
371
+ ```
372
+
373
+ ---
374
+
375
+ ## ▸ Platform Support
376
+
377
+ | OS | Python 3.9 | Python 3.10 | Python 3.11 | Python 3.12 |
378
+ |----|:----------:|:-----------:|:-----------:|:-----------:|
379
+ | macOS | ✓ | ✓ | ✓ | ✓ |
380
+ | Ubuntu | ✓ | ✓ | ✓ | ✓ |
381
+ | Windows | ✓ | ✓ | ✓ | ✓ |
382
+
383
+ ---
384
+
385
+ ## ▸ License
386
+
387
+ MIT License — see [LICENSE](LICENSE)
388
+
389
+ ---
390
+
391
+ <div align="center">
392
+
393
+ Made in 🇮🇳 with ❤️ by [MOHIT BAGRI](https://github.com/Mohit-Bagri)
394
+
395
+ **CacheKaro** - *Clean It Up!*
396
+
397
+ </div>