b2-cleanup 0.1.0__py3-none-any.whl → 0.1.3__py3-none-any.whl

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.
@@ -0,0 +1,142 @@
1
+ Metadata-Version: 2.4
2
+ Name: b2-cleanup
3
+ Version: 0.1.3
4
+ Summary: CLI tool to clean up unfinished Backblaze B2 large uploads
5
+ Author-email: Jeroen Verhoeven <jeroen@joentje.org>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/your-username/b2-cleanup
8
+ Project-URL: Issues, https://github.com/your-username/b2-cleanup/issues
9
+ Keywords: backblaze,b2,cli,cloud-storage,cleanup
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Topic :: Utilities
19
+ Requires-Python: >=3.8
20
+ Description-Content-Type: text/markdown
21
+ Requires-Dist: click>=8.0
22
+ Requires-Dist: b2sdk>=1.20.0
23
+
24
+ # b2-cleanup
25
+
26
+ 🧹 A Python CLI tool to clean up **unfinished large file uploads** in a [Backblaze B2](https://www.backblaze.com/b2/cloud-storage.html) bucket.
27
+
28
+ Built using [`b2sdk`](https://github.com/Backblaze/b2-sdk-python), [`click`](https://click.palletsprojects.com/), and [`uv`](https://github.com/astral-sh/uv) for performance and reproducibility.
29
+
30
+ ---
31
+
32
+ ## 🔧 Features
33
+
34
+ - Lists all unfinished large file uploads in a given B2 bucket
35
+ - Optionally cancels them (dry-run support included)
36
+ - Uses the official `b2sdk` for native Backblaze API access
37
+ - Supports authentication via env vars, CLI override, or the `b2` CLI
38
+ - Clean CLI with logging support
39
+ - Class-based and easily extensible
40
+
41
+ ---
42
+
43
+ ## 🚀 Installation
44
+
45
+ ### 1. Clone and create an isolated environment
46
+
47
+ ```bash
48
+ git clone https://github.com/<your-username>/b2-cleanup.git
49
+ cd b2-cleanup
50
+
51
+ uv venv
52
+ source .venv/bin/activate
53
+ uv pip install -e .
54
+ ```
55
+
56
+ > Requires [uv](https://github.com/astral-sh/uv) and Python 3.8+
57
+
58
+ ---
59
+
60
+ ## 🧪 Usage
61
+
62
+ ```bash
63
+ b2-cleanup BUCKET_NAME [OPTIONS]
64
+ ```
65
+
66
+ ### Example (dry run):
67
+
68
+ ```bash
69
+ b2-cleanup my-bucket --dry-run
70
+ ```
71
+
72
+ ### Example (delete for real, with logging):
73
+
74
+ ```bash
75
+ b2-cleanup my-bucket --log-file cleanup_$(date +%F).log
76
+ ```
77
+
78
+ ### Example (override credentials):
79
+
80
+ ```bash
81
+ b2-cleanup my-bucket --key-id my-key-id --key my-app-key
82
+ ```
83
+
84
+ ---
85
+
86
+ ## 🔐 Authentication
87
+
88
+ This tool supports three ways to authenticate with B2, in priority order:
89
+
90
+ 1. **Explicit CLI arguments**:
91
+ ```bash
92
+ b2-cleanup my-bucket --key-id abc123 --key supersecretkey
93
+ ```
94
+
95
+ 2. **Environment variables**:
96
+ ```bash
97
+ export B2_APPLICATION_KEY_ID=abc123
98
+ export B2_APPLICATION_KEY=supersecretkey
99
+ ```
100
+
101
+ 3. **The `b2` CLI** (must be previously authorized):
102
+ ```bash
103
+ b2 account authorize
104
+ # Then the tool will read credentials via:
105
+ b2 account info
106
+ ```
107
+
108
+ ---
109
+
110
+ ## 📁 Project Structure
111
+
112
+ ```
113
+ b2-cleanup/
114
+ ├── cleanup_unfinished_b2_uploads.py # Core CLI logic (class-based)
115
+ ├── pyproject.toml # Project metadata + dependencies
116
+ ├── .gitignore
117
+ └── README.md
118
+ ```
119
+
120
+ ---
121
+
122
+ ## 📦 Packaging Notes
123
+
124
+ - The CLI entry point is `b2-cleanup` via `pyproject.toml`
125
+ - Install in editable mode (`uv pip install -e .`) for fast development
126
+ - Dependencies are managed via [`uv`](https://github.com/astral-sh/uv)
127
+
128
+ ---
129
+
130
+ ## 🛠️ Roadmap
131
+
132
+ - [ ] Filter uploads by file age
133
+ - [ ] Support multiple buckets
134
+ - [ ] Output metrics (count, size, cost saved)
135
+ - [ ] Optional integration with S3-compatible B2 APIs
136
+
137
+ ---
138
+
139
+ ## 📝 License
140
+
141
+ MIT License © 2025 Jeroen Verhoeven
142
+
@@ -0,0 +1,6 @@
1
+ cleanup_unfinished_b2_uploads.py,sha256=_wShubS02qNxiRdJmuNSoLzcjd7epcB3Q_fU1CDpH_Q,3877
2
+ b2_cleanup-0.1.3.dist-info/METADATA,sha256=Q4FYPDetwgRQE8GEXZw4H0H0gdX6oKnZakGieaFtWOw,3490
3
+ b2_cleanup-0.1.3.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
4
+ b2_cleanup-0.1.3.dist-info/entry_points.txt,sha256=hRMR8HC39r-P1TrTPYbH3hDQkBVvDb508tOUS8a0CcI,65
5
+ b2_cleanup-0.1.3.dist-info/top_level.txt,sha256=GmKi68dORi-iv2h2sT5Uf7Q3udlX1mElQQg50cqqF6o,30
6
+ b2_cleanup-0.1.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.0.1)
2
+ Generator: setuptools (80.3.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,7 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: b2-cleanup
3
- Version: 0.1.0
4
- Summary: Cleanup unfinished Backblaze B2 large uploads
5
- Author-email: Jeroen Verhoeven <jeroen@joentje.org>
6
- Requires-Dist: click>=8.0
7
- Requires-Dist: b2sdk>=2.8.1
@@ -1,6 +0,0 @@
1
- cleanup_unfinished_b2_uploads.py,sha256=_wShubS02qNxiRdJmuNSoLzcjd7epcB3Q_fU1CDpH_Q,3877
2
- b2_cleanup-0.1.0.dist-info/METADATA,sha256=kHW0eHyzVtwFoYT9WNbG5g2HKJ6bESQ7YnXD4wLN1XY,215
3
- b2_cleanup-0.1.0.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
4
- b2_cleanup-0.1.0.dist-info/entry_points.txt,sha256=hRMR8HC39r-P1TrTPYbH3hDQkBVvDb508tOUS8a0CcI,65
5
- b2_cleanup-0.1.0.dist-info/top_level.txt,sha256=GmKi68dORi-iv2h2sT5Uf7Q3udlX1mElQQg50cqqF6o,30
6
- b2_cleanup-0.1.0.dist-info/RECORD,,