optforge 0.3.11__tar.gz → 0.3.12__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.
- {optforge-0.3.11 → optforge-0.3.12}/.gitignore +1 -0
- {optforge-0.3.11 → optforge-0.3.12}/PKG-INFO +56 -3
- {optforge-0.3.11 → optforge-0.3.12}/README.md +54 -2
- {optforge-0.3.11 → optforge-0.3.12}/pyproject.toml +2 -0
- optforge-0.3.12/src/optforge/_version.py +1 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/cli.py +3 -2
- optforge-0.3.12/src/optforge/qrme/qrme.py +80 -0
- optforge-0.3.11/src/optforge/_version.py +0 -1
- {optforge-0.3.11 → optforge-0.3.12}/LICENSE +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/Makefile +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/__init__.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/__main__.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/core/__init__.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/core/cli.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/core/console.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/core/errors.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/core/formatting.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/core/net.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/core/processes.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/core/redaction.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/core/version.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/diskcheck/__init__.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/diskcheck/cli.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/diskcheck/models.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/diskcheck/service.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/envcheck/__init__.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/envcheck/cli.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/envcheck/models.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/envcheck/service.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/killNotif/__init__.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/killNotif/cli.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/killNotif/core.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/killNotif/job.ps1 +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/portcheck/__init__.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/portcheck/binder.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/portcheck/cli.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/portcheck/connector.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/portcheck/models.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/portcheck/scanner.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/portcheck/service.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/portcheck/waiter.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/py.typed +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/pycacheclean/__init__.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/pycacheclean/cleaner.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/pycacheclean/cli.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/pycacheclean/models.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/pycacheclean/scanner.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/pycacheclean/service.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/ranpass/ranpass.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/volume/__init__.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/volume/cli.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/src/optforge/volume/core.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/tests/test_cli.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/tests/test_console.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/tests/test_diskcheck.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/tests/test_envcheck.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/tests/test_formatting.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/tests/test_killnotif.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/tests/test_net.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/tests/test_portcheck.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/tests/test_processes.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/tests/test_pycacheclean.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/tests/test_redaction.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/tests/test_version.py +0 -0
- {optforge-0.3.11 → optforge-0.3.12}/tests/test_volume.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: optforge
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.12
|
|
4
4
|
Summary: Cross-platform developer CLI tools for ports, environment variables, disk usage, and Python cache cleanup.
|
|
5
5
|
Project-URL: Homepage, https://github.com/cmd-3324/OptForge
|
|
6
6
|
Project-URL: Repository, https://github.com/cmd-3324/OptForge
|
|
@@ -28,6 +28,7 @@ Requires-Dist: pulumi-command>=1.3.0
|
|
|
28
28
|
Requires-Dist: pulumi>=3.277.0
|
|
29
29
|
Requires-Dist: pycaw>=20240210; sys_platform == 'win32'
|
|
30
30
|
Requires-Dist: pyperclip
|
|
31
|
+
Requires-Dist: qrcode[pil]>=8.0
|
|
31
32
|
Requires-Dist: rich>=13.7.0
|
|
32
33
|
Requires-Dist: typer>=0.12.0
|
|
33
34
|
Provides-Extra: dev
|
|
@@ -40,7 +41,7 @@ Description-Content-Type: text/markdown
|
|
|
40
41
|
|
|
41
42
|
# OptForge
|
|
42
43
|
|
|
43
|
-
Small developer CLI tools for inspecting listening ports, checking environment variables, monitoring disk usage, cleaning Python cache artifacts, controlling output volume,
|
|
44
|
+
Small developer CLI tools for inspecting listening ports, checking environment variables, monitoring disk usage, cleaning Python cache artifacts, controlling output volume, clearing Windows toast notifications, generating secure passwords, and generating QR codes. Most tools are cross-platform; `killNotif` is Windows-only.
|
|
44
45
|
|
|
45
46
|
Built with Python, Typer, and Rich.
|
|
46
47
|
|
|
@@ -58,6 +59,8 @@ It helps you:
|
|
|
58
59
|
- remove stale Python cache artifacts from local projects, without scanning `venv` or `.venv`
|
|
59
60
|
- get, set, mute, and adjust the default output volume
|
|
60
61
|
- clear Windows toast notifications, optionally for a single app (Windows 10/11 only)
|
|
62
|
+
- generate random passwords with custom length and character sets, copied straight to the clipboard
|
|
63
|
+
- generate QR codes from URLs or text, save them as PNG, and open them automatically
|
|
61
64
|
|
|
62
65
|
## Why use OptForge?
|
|
63
66
|
|
|
@@ -110,6 +113,23 @@ Most tools are designed to be simple, fast, and cross-platform; `killNotif` is W
|
|
|
110
113
|
- requires Windows 10/11 and Windows PowerShell 5.1+
|
|
111
114
|
- not available on macOS or Linux; the command exits with code `3` there
|
|
112
115
|
|
|
116
|
+
### Password generation
|
|
117
|
+
|
|
118
|
+
- generate passwords with the `secrets` module (cryptographically strong)
|
|
119
|
+
- optional length argument, or random length between `--min` and `--max`
|
|
120
|
+
- toggle lowercase letters (`-l`), digits (`-n`), and special characters (`-s`)
|
|
121
|
+
- default character set: letters + digits + punctuation when no flag is given
|
|
122
|
+
- password copied to the clipboard automatically; desktop notification confirms
|
|
123
|
+
- middle characters masked in the terminal output; full password still goes to the clipboard
|
|
124
|
+
|
|
125
|
+
### QR code generation
|
|
126
|
+
|
|
127
|
+
- generate a QR code from a URL or any text
|
|
128
|
+
- save as PNG to a chosen folder or file path
|
|
129
|
+
- automatically pick a unique filename (`qrcode_1.png`, `qrcode_2.png`, ...) on collision
|
|
130
|
+
- open the saved image in the default viewer after generation
|
|
131
|
+
- `deleteAll` removes every `qrcode*.png` from the target folder after a confirmation delay
|
|
132
|
+
|
|
113
133
|
## Installation
|
|
114
134
|
|
|
115
135
|
Python 3.11 or newer is required.
|
|
@@ -149,6 +169,8 @@ pycache-clean --help
|
|
|
149
169
|
vol --help
|
|
150
170
|
killNotif --help # Windows 10/11 only
|
|
151
171
|
optforge killNotif --help
|
|
172
|
+
ranpass --help
|
|
173
|
+
qrme --help
|
|
152
174
|
```
|
|
153
175
|
|
|
154
176
|
## Platform support
|
|
@@ -157,6 +179,8 @@ optforge killNotif --help
|
|
|
157
179
|
| --- | --- | --- | --- |
|
|
158
180
|
| `portcheck`, `envcheck`, `diskcheck`, `pycache-clean` | Yes | Yes | Yes |
|
|
159
181
|
| `vol` | Yes | Yes | Yes |
|
|
182
|
+
| `ranpass` | Yes | Yes | Yes |
|
|
183
|
+
| `qrme` | Yes | Yes | Yes |
|
|
160
184
|
| `killNotif` | Windows 10/11 only | No | No |
|
|
161
185
|
|
|
162
186
|
`vol` uses the system mixer: Core Audio on Windows, `osascript` on macOS, and `pactl`/`wpctl`/`amixer` on Linux.
|
|
@@ -236,6 +260,31 @@ killNotif --quiet
|
|
|
236
260
|
|
|
237
261
|
Use `--aumid` to target one sender. `--json` prints `{"aumid": ..., "cleared": ...}`, and `--quiet` suppresses output. The command exits `0` on success, including when there was nothing to clear, and `3` when it cannot run.
|
|
238
262
|
|
|
263
|
+
### Generate passwords
|
|
264
|
+
|
|
265
|
+
`ranpass` builds a random password, copies it to the clipboard, and shows a desktop notification. Length is optional; when omitted, length is chosen randomly between `--min` and `--max`.
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
ranpass # random length, full character set
|
|
269
|
+
ranpass 16 # 16 characters, full character set
|
|
270
|
+
ranpass 12 -l -n # letters and digits only
|
|
271
|
+
ranpass 20 -s # include special characters
|
|
272
|
+
ranpass 12 --min 8 --max 16
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Flags: `-l`/`--letter` (lowercase), `-n`/`--number` (digits), `-s`/`--stuff` (punctuation). With no flags, letters + digits + punctuation are used. The terminal prints the password with the middle masked (`a**********z`); the clipboard gets the full password.
|
|
276
|
+
|
|
277
|
+
### Generate QR codes
|
|
278
|
+
|
|
279
|
+
`qrme` builds a QR code from a URL or text, saves it as a PNG, and opens it in the default image viewer.
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
optforge qrme startup # interactive: enter text, choose save location
|
|
283
|
+
optforge qrme deleteAll # remove all qrcode*.png from the target folder
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
`startup` prompts for the content and the save path (defaults to `~/Documents`). If the path is a directory, the file is saved as `qrcode.png` inside it; an existing file gets a `_1`, `_2`, ... suffix. `deleteAll` asks for confirmation, waits 10 seconds (press `Ctrl+C` to cancel), then removes every `qrcode*.png` from the folder.
|
|
287
|
+
|
|
239
288
|
## Project structure
|
|
240
289
|
|
|
241
290
|
```text
|
|
@@ -248,6 +297,8 @@ OptForge/
|
|
|
248
297
|
│ ├── killNotif/
|
|
249
298
|
│ ├── portcheck/
|
|
250
299
|
│ ├── pycacheclean/
|
|
300
|
+
│ ├── qrme/
|
|
301
|
+
│ ├── ranpass/
|
|
251
302
|
│ └── volume/
|
|
252
303
|
├── Makefile
|
|
253
304
|
├── README.md
|
|
@@ -279,6 +330,8 @@ make test
|
|
|
279
330
|
- pycaw for `vol` on Windows (installed automatically)
|
|
280
331
|
- `pactl`, `wpctl`, or `amixer` for `vol` on Linux
|
|
281
332
|
- Windows 10/11 and Windows PowerShell 5.1+ for `killNotif`
|
|
333
|
+
- pyperclip and plyer for `ranpass` clipboard copy and notifications (installed automatically)
|
|
334
|
+
- qrcode with Pillow for `qrme` PNG output (installed automatically)
|
|
282
335
|
|
|
283
336
|
All other commands work on Windows, macOS, and Linux.
|
|
284
337
|
|
|
@@ -298,4 +351,4 @@ MIT. See [LICENSE](LICENSE).
|
|
|
298
351
|
|
|
299
352
|
## Summary
|
|
300
353
|
|
|
301
|
-
OptForge is a practical toolkit for developers working on local environments, especially when they need fast answers about ports, runtime configuration, storage health, output volume, Python project clutter,
|
|
354
|
+
OptForge is a practical toolkit for developers working on local environments, especially when they need fast answers about ports, runtime configuration, storage health, output volume, Python project clutter, Windows notification noise, quick password generation, and QR code creation.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OptForge
|
|
2
2
|
|
|
3
|
-
Small developer CLI tools for inspecting listening ports, checking environment variables, monitoring disk usage, cleaning Python cache artifacts, controlling output volume,
|
|
3
|
+
Small developer CLI tools for inspecting listening ports, checking environment variables, monitoring disk usage, cleaning Python cache artifacts, controlling output volume, clearing Windows toast notifications, generating secure passwords, and generating QR codes. Most tools are cross-platform; `killNotif` is Windows-only.
|
|
4
4
|
|
|
5
5
|
Built with Python, Typer, and Rich.
|
|
6
6
|
|
|
@@ -18,6 +18,8 @@ It helps you:
|
|
|
18
18
|
- remove stale Python cache artifacts from local projects, without scanning `venv` or `.venv`
|
|
19
19
|
- get, set, mute, and adjust the default output volume
|
|
20
20
|
- clear Windows toast notifications, optionally for a single app (Windows 10/11 only)
|
|
21
|
+
- generate random passwords with custom length and character sets, copied straight to the clipboard
|
|
22
|
+
- generate QR codes from URLs or text, save them as PNG, and open them automatically
|
|
21
23
|
|
|
22
24
|
## Why use OptForge?
|
|
23
25
|
|
|
@@ -70,6 +72,23 @@ Most tools are designed to be simple, fast, and cross-platform; `killNotif` is W
|
|
|
70
72
|
- requires Windows 10/11 and Windows PowerShell 5.1+
|
|
71
73
|
- not available on macOS or Linux; the command exits with code `3` there
|
|
72
74
|
|
|
75
|
+
### Password generation
|
|
76
|
+
|
|
77
|
+
- generate passwords with the `secrets` module (cryptographically strong)
|
|
78
|
+
- optional length argument, or random length between `--min` and `--max`
|
|
79
|
+
- toggle lowercase letters (`-l`), digits (`-n`), and special characters (`-s`)
|
|
80
|
+
- default character set: letters + digits + punctuation when no flag is given
|
|
81
|
+
- password copied to the clipboard automatically; desktop notification confirms
|
|
82
|
+
- middle characters masked in the terminal output; full password still goes to the clipboard
|
|
83
|
+
|
|
84
|
+
### QR code generation
|
|
85
|
+
|
|
86
|
+
- generate a QR code from a URL or any text
|
|
87
|
+
- save as PNG to a chosen folder or file path
|
|
88
|
+
- automatically pick a unique filename (`qrcode_1.png`, `qrcode_2.png`, ...) on collision
|
|
89
|
+
- open the saved image in the default viewer after generation
|
|
90
|
+
- `deleteAll` removes every `qrcode*.png` from the target folder after a confirmation delay
|
|
91
|
+
|
|
73
92
|
## Installation
|
|
74
93
|
|
|
75
94
|
Python 3.11 or newer is required.
|
|
@@ -109,6 +128,8 @@ pycache-clean --help
|
|
|
109
128
|
vol --help
|
|
110
129
|
killNotif --help # Windows 10/11 only
|
|
111
130
|
optforge killNotif --help
|
|
131
|
+
ranpass --help
|
|
132
|
+
qrme --help
|
|
112
133
|
```
|
|
113
134
|
|
|
114
135
|
## Platform support
|
|
@@ -117,6 +138,8 @@ optforge killNotif --help
|
|
|
117
138
|
| --- | --- | --- | --- |
|
|
118
139
|
| `portcheck`, `envcheck`, `diskcheck`, `pycache-clean` | Yes | Yes | Yes |
|
|
119
140
|
| `vol` | Yes | Yes | Yes |
|
|
141
|
+
| `ranpass` | Yes | Yes | Yes |
|
|
142
|
+
| `qrme` | Yes | Yes | Yes |
|
|
120
143
|
| `killNotif` | Windows 10/11 only | No | No |
|
|
121
144
|
|
|
122
145
|
`vol` uses the system mixer: Core Audio on Windows, `osascript` on macOS, and `pactl`/`wpctl`/`amixer` on Linux.
|
|
@@ -196,6 +219,31 @@ killNotif --quiet
|
|
|
196
219
|
|
|
197
220
|
Use `--aumid` to target one sender. `--json` prints `{"aumid": ..., "cleared": ...}`, and `--quiet` suppresses output. The command exits `0` on success, including when there was nothing to clear, and `3` when it cannot run.
|
|
198
221
|
|
|
222
|
+
### Generate passwords
|
|
223
|
+
|
|
224
|
+
`ranpass` builds a random password, copies it to the clipboard, and shows a desktop notification. Length is optional; when omitted, length is chosen randomly between `--min` and `--max`.
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
ranpass # random length, full character set
|
|
228
|
+
ranpass 16 # 16 characters, full character set
|
|
229
|
+
ranpass 12 -l -n # letters and digits only
|
|
230
|
+
ranpass 20 -s # include special characters
|
|
231
|
+
ranpass 12 --min 8 --max 16
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Flags: `-l`/`--letter` (lowercase), `-n`/`--number` (digits), `-s`/`--stuff` (punctuation). With no flags, letters + digits + punctuation are used. The terminal prints the password with the middle masked (`a**********z`); the clipboard gets the full password.
|
|
235
|
+
|
|
236
|
+
### Generate QR codes
|
|
237
|
+
|
|
238
|
+
`qrme` builds a QR code from a URL or text, saves it as a PNG, and opens it in the default image viewer.
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
optforge qrme startup # interactive: enter text, choose save location
|
|
242
|
+
optforge qrme deleteAll # remove all qrcode*.png from the target folder
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
`startup` prompts for the content and the save path (defaults to `~/Documents`). If the path is a directory, the file is saved as `qrcode.png` inside it; an existing file gets a `_1`, `_2`, ... suffix. `deleteAll` asks for confirmation, waits 10 seconds (press `Ctrl+C` to cancel), then removes every `qrcode*.png` from the folder.
|
|
246
|
+
|
|
199
247
|
## Project structure
|
|
200
248
|
|
|
201
249
|
```text
|
|
@@ -208,6 +256,8 @@ OptForge/
|
|
|
208
256
|
│ ├── killNotif/
|
|
209
257
|
│ ├── portcheck/
|
|
210
258
|
│ ├── pycacheclean/
|
|
259
|
+
│ ├── qrme/
|
|
260
|
+
│ ├── ranpass/
|
|
211
261
|
│ └── volume/
|
|
212
262
|
├── Makefile
|
|
213
263
|
├── README.md
|
|
@@ -239,6 +289,8 @@ make test
|
|
|
239
289
|
- pycaw for `vol` on Windows (installed automatically)
|
|
240
290
|
- `pactl`, `wpctl`, or `amixer` for `vol` on Linux
|
|
241
291
|
- Windows 10/11 and Windows PowerShell 5.1+ for `killNotif`
|
|
292
|
+
- pyperclip and plyer for `ranpass` clipboard copy and notifications (installed automatically)
|
|
293
|
+
- qrcode with Pillow for `qrme` PNG output (installed automatically)
|
|
242
294
|
|
|
243
295
|
All other commands work on Windows, macOS, and Linux.
|
|
244
296
|
|
|
@@ -258,4 +310,4 @@ MIT. See [LICENSE](LICENSE).
|
|
|
258
310
|
|
|
259
311
|
## Summary
|
|
260
312
|
|
|
261
|
-
OptForge is a practical toolkit for developers working on local environments, especially when they need fast answers about ports, runtime configuration, storage health, output volume, Python project clutter,
|
|
313
|
+
OptForge is a practical toolkit for developers working on local environments, especially when they need fast answers about ports, runtime configuration, storage health, output volume, Python project clutter, Windows notification noise, quick password generation, and QR code creation.
|
|
@@ -34,6 +34,7 @@ dependencies = [
|
|
|
34
34
|
"typer>=0.12.0",
|
|
35
35
|
"pyperclip",
|
|
36
36
|
"plyer",
|
|
37
|
+
"qrcode[pil]>=8.0",
|
|
37
38
|
]
|
|
38
39
|
|
|
39
40
|
[project.optional-dependencies]
|
|
@@ -55,6 +56,7 @@ pycacheClean = "optforge.pycacheclean.cli:app"
|
|
|
55
56
|
killNotif = "optforge.killNotif.cli:app"
|
|
56
57
|
vol = "optforge.volume.cli:app"
|
|
57
58
|
ranpass = "optforge.ranpass.ranpass:main"
|
|
59
|
+
qrme = "optforge.qrme.qrme:app"
|
|
58
60
|
|
|
59
61
|
[project.urls]
|
|
60
62
|
Homepage = "https://github.com/cmd-3324/OptForge"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.3.12"
|
|
@@ -13,10 +13,11 @@ from optforge.killNotif.cli import app as killnotif_app
|
|
|
13
13
|
from optforge.portcheck.cli import app as portcheck_app
|
|
14
14
|
from optforge.pycacheclean.cli import app as pycacheclean_app
|
|
15
15
|
from optforge.volume.cli import app as volume_app
|
|
16
|
+
from optforge.qrme.qrme import app as qr_app
|
|
16
17
|
from optforge.ranpass.ranpass import app as ran_app
|
|
17
18
|
app = typer.Typer(
|
|
18
19
|
name="optforge",
|
|
19
|
-
help="Developer utilities for ports, environment variables, disk usage, Python caches, Random Password and volume.",
|
|
20
|
+
help="Developer utilities for ports, environment variables, disk usage, Python caches,QrCode Generation, Random Password and volume.",
|
|
20
21
|
no_args_is_help=True,
|
|
21
22
|
rich_markup_mode="rich",
|
|
22
23
|
context_settings={"help_option_names": ["-h", "--help"]},
|
|
@@ -53,6 +54,6 @@ app.add_typer(pycacheclean_app, name="pycacheClean", hidden=True)
|
|
|
53
54
|
app.add_typer(killnotif_app, name="killNotif")
|
|
54
55
|
app.add_typer(volume_app, name="vol")
|
|
55
56
|
app.add_typer(ran_app, name="ranpas")
|
|
56
|
-
|
|
57
|
+
app.add_typer(qr_app, name="qrme")
|
|
57
58
|
if __name__ == "__main__":
|
|
58
59
|
app()
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import shutil as sh
|
|
2
|
+
import subprocess as sb
|
|
3
|
+
import tempfile
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from sys import platform
|
|
6
|
+
from time import sleep
|
|
7
|
+
|
|
8
|
+
from qrcode import *
|
|
9
|
+
from rich.console import Console
|
|
10
|
+
from typer import Exit, Typer, prompt
|
|
11
|
+
|
|
12
|
+
console = Console()
|
|
13
|
+
app = Typer(name="QRCODE Generator", help="This script generates and saves a QR code for you.")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def get_unique_path(file_path: Path, count=1) -> Path:
|
|
17
|
+
if not file_path.exists():
|
|
18
|
+
return file_path
|
|
19
|
+
|
|
20
|
+
while True:
|
|
21
|
+
# Stem returns name of a file in a path without its suffix
|
|
22
|
+
new_path = file_path.with_stem(f"{file_path.stem}_{count}")
|
|
23
|
+
if not new_path.exists():
|
|
24
|
+
return new_path
|
|
25
|
+
count += 1
|
|
26
|
+
|
|
27
|
+
default_dir = Path.home() / "Documents"
|
|
28
|
+
|
|
29
|
+
@app.command("deleteAll")
|
|
30
|
+
def _remove_all_qrcodes(base_dir: Path = default_dir):
|
|
31
|
+
if not base_dir.is_dir():
|
|
32
|
+
raise FileNotFoundError(f"{base_dir} does not exist!.")
|
|
33
|
+
files = [f for f in list(base_dir.glob("qrcode*.png"))]
|
|
34
|
+
confirm = prompt("Are you sure to do this ? (Y/N):", default="N")
|
|
35
|
+
try:
|
|
36
|
+
if confirm.upper() == "Y":
|
|
37
|
+
console.print("All PNG files will be gone in 10s - Press [yellow] CTRL + C [/yellow] to STOP")
|
|
38
|
+
sleep(10)
|
|
39
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
40
|
+
for f in files:
|
|
41
|
+
sh.move(f,tmp)
|
|
42
|
+
console.print("[red] All The png files created by QRME are gone.[/red]")
|
|
43
|
+
except KeyboardInterrupt:
|
|
44
|
+
console.print("[green] Operation Canceled.[/green]")
|
|
45
|
+
# get from - to number - move Or remove them
|
|
46
|
+
@app.command()
|
|
47
|
+
def startup():
|
|
48
|
+
value: str = prompt("Enter the URL or text", default="")
|
|
49
|
+
if not value.strip():
|
|
50
|
+
console.print("[bold red]Error:[/bold red] Please enter a valid value.")
|
|
51
|
+
raise Exit(code=1)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
save_input: str = prompt("Where should I save the file?", default=str(default_dir))
|
|
55
|
+
save_path = Path(save_input).expanduser()
|
|
56
|
+
|
|
57
|
+
if save_path.is_dir():
|
|
58
|
+
save_path = save_path / "qrcode.png"
|
|
59
|
+
elif not save_path.suffix:
|
|
60
|
+
save_path = save_path.with_suffix(".png")
|
|
61
|
+
|
|
62
|
+
save_path = get_unique_path(save_path)
|
|
63
|
+
save_path.parent.mkdir(parents=True, exist_ok=True)
|
|
64
|
+
shortcuts = {
|
|
65
|
+
'win32' : f"start {save_path}",
|
|
66
|
+
'linux' : f"xdg-open '{save_path}'",
|
|
67
|
+
'darwin' : f"open '{save_path}'", # I use both Linux and Windows 10(Dual boot) but have never used a mac before
|
|
68
|
+
}
|
|
69
|
+
cmd = shortcuts.get(platform)
|
|
70
|
+
result = make(value)
|
|
71
|
+
result.save(save_path)
|
|
72
|
+
console.print("[cyan]Opening QRCODE[/cyan]")
|
|
73
|
+
sleep(3)
|
|
74
|
+
if cmd:
|
|
75
|
+
sb.run(cmd, check=False, shell=True)
|
|
76
|
+
console.print(f"[bold green]Success![/bold green] QR code saved to: [cyan]{save_path}[/cyan]")
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
if __name__ == "__main__":
|
|
80
|
+
app()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.3.11"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|