b2-cleanup 0.1.0__tar.gz → 0.1.3__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.
@@ -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
+
@@ -11,6 +11,7 @@ Built using [`b2sdk`](https://github.com/Backblaze/b2-sdk-python), [`click`](htt
11
11
  - Lists all unfinished large file uploads in a given B2 bucket
12
12
  - Optionally cancels them (dry-run support included)
13
13
  - Uses the official `b2sdk` for native Backblaze API access
14
+ - Supports authentication via env vars, CLI override, or the `b2` CLI
14
15
  - Clean CLI with logging support
15
16
  - Class-based and easily extensible
16
17
 
@@ -51,17 +52,35 @@ b2-cleanup my-bucket --dry-run
51
52
  b2-cleanup my-bucket --log-file cleanup_$(date +%F).log
52
53
  ```
53
54
 
55
+ ### Example (override credentials):
56
+
57
+ ```bash
58
+ b2-cleanup my-bucket --key-id my-key-id --key my-app-key
59
+ ```
60
+
54
61
  ---
55
62
 
56
63
  ## 🔐 Authentication
57
64
 
58
- You must be logged in with the `b2` CLI at least once:
65
+ This tool supports three ways to authenticate with B2, in priority order:
59
66
 
60
- ```bash
61
- b2 authorize-account
62
- ```
67
+ 1. **Explicit CLI arguments**:
68
+ ```bash
69
+ b2-cleanup my-bucket --key-id abc123 --key supersecretkey
70
+ ```
63
71
 
64
- This stores credentials in `~/.b2_account_info`, which the tool reuses.
72
+ 2. **Environment variables**:
73
+ ```bash
74
+ export B2_APPLICATION_KEY_ID=abc123
75
+ export B2_APPLICATION_KEY=supersecretkey
76
+ ```
77
+
78
+ 3. **The `b2` CLI** (must be previously authorized):
79
+ ```bash
80
+ b2 account authorize
81
+ # Then the tool will read credentials via:
82
+ b2 account info
83
+ ```
65
84
 
66
85
  ---
67
86
 
@@ -81,7 +100,7 @@ b2-cleanup/
81
100
 
82
101
  - The CLI entry point is `b2-cleanup` via `pyproject.toml`
83
102
  - Install in editable mode (`uv pip install -e .`) for fast development
84
- - Dependencies are managed via [`uv`](https://github.com/astral-sh/uv) for reproducibility and speed
103
+ - Dependencies are managed via [`uv`](https://github.com/astral-sh/uv)
85
104
 
86
105
  ---
87
106
 
@@ -96,4 +115,5 @@ b2-cleanup/
96
115
 
97
116
  ## 📝 License
98
117
 
99
- MIT License © 2025 Your Name
118
+ MIT License © 2025 Jeroen Verhoeven
119
+
@@ -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,2 @@
1
+ click>=8.0
2
+ b2sdk>=1.20.0
@@ -0,0 +1,39 @@
1
+ [project]
2
+ name = "b2-cleanup"
3
+ version = "0.1.3"
4
+ description = "CLI tool to clean up unfinished Backblaze B2 large uploads"
5
+ readme = "README.md"
6
+ requires-python = ">=3.8"
7
+ license = { text = "MIT" }
8
+ authors = [
9
+ { name = "Jeroen Verhoeven", email = "jeroen@joentje.org" }
10
+ ]
11
+ keywords = ["backblaze", "b2", "cli", "cloud-storage", "cleanup"]
12
+ classifiers = [
13
+ "Development Status :: 4 - Beta",
14
+ "License :: OSI Approved :: MIT License",
15
+ "Programming Language :: Python :: 3",
16
+ "Programming Language :: Python :: 3.8",
17
+ "Programming Language :: Python :: 3.9",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Intended Audience :: Developers",
21
+ "Topic :: Utilities",
22
+ ]
23
+
24
+ dependencies = [
25
+ "click>=8.0",
26
+ "b2sdk>=1.20.0"
27
+ ]
28
+
29
+ [project.urls]
30
+ "Homepage" = "https://github.com/your-username/b2-cleanup"
31
+ "Issues" = "https://github.com/your-username/b2-cleanup/issues"
32
+
33
+ [project.scripts]
34
+ b2-cleanup = "cleanup_unfinished_b2_uploads:cli"
35
+
36
+ [build-system]
37
+ requires = ["setuptools>=61.0"]
38
+ build-backend = "setuptools.build_meta"
39
+
b2_cleanup-0.1.0/PKG-INFO DELETED
@@ -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,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,2 +0,0 @@
1
- click>=8.0
2
- b2sdk>=2.8.1
@@ -1,15 +0,0 @@
1
- [project]
2
- name = "b2-cleanup"
3
- version = "0.1.0"
4
- description = "Cleanup unfinished Backblaze B2 large uploads"
5
- authors = [
6
- { name = "Jeroen Verhoeven", email = "jeroen@joentje.org" }
7
- ]
8
- dependencies = [
9
- "click>=8.0",
10
- "b2sdk>=2.8.1"
11
- ]
12
-
13
- [project.scripts]
14
- b2-cleanup = "cleanup_unfinished_b2_uploads:cli"
15
-
File without changes