optforge 0.3.10__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.10 → optforge-0.3.12}/.gitignore +4 -0
- {optforge-0.3.10 → optforge-0.3.12}/PKG-INFO +60 -3
- {optforge-0.3.10 → optforge-0.3.12}/README.md +54 -2
- {optforge-0.3.10 → optforge-0.3.12}/pyproject.toml +7 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/__main__.py +1 -0
- optforge-0.3.12/src/optforge/_version.py +1 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/cli.py +5 -4
- optforge-0.3.12/src/optforge/qrme/qrme.py +80 -0
- optforge-0.3.12/src/optforge/ranpass/ranpass.py +150 -0
- optforge-0.3.10/src/optforge/_version.py +0 -1
- {optforge-0.3.10 → optforge-0.3.12}/LICENSE +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/Makefile +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/__init__.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/core/__init__.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/core/cli.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/core/console.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/core/errors.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/core/formatting.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/core/net.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/core/processes.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/core/redaction.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/core/version.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/diskcheck/__init__.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/diskcheck/cli.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/diskcheck/models.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/diskcheck/service.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/envcheck/__init__.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/envcheck/cli.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/envcheck/models.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/envcheck/service.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/killNotif/__init__.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/killNotif/cli.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/killNotif/core.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/killNotif/job.ps1 +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/portcheck/__init__.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/portcheck/binder.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/portcheck/cli.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/portcheck/connector.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/portcheck/models.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/portcheck/scanner.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/portcheck/service.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/portcheck/waiter.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/py.typed +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/pycacheclean/__init__.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/pycacheclean/cleaner.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/pycacheclean/cli.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/pycacheclean/models.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/pycacheclean/scanner.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/pycacheclean/service.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/volume/__init__.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/volume/cli.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/src/optforge/volume/core.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/tests/test_cli.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/tests/test_console.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/tests/test_diskcheck.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/tests/test_envcheck.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/tests/test_formatting.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/tests/test_killnotif.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/tests/test_net.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/tests/test_portcheck.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/tests/test_processes.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/tests/test_pycacheclean.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/tests/test_redaction.py +0 -0
- {optforge-0.3.10 → optforge-0.3.12}/tests/test_version.py +0 -0
- {optforge-0.3.10 → 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
|
|
@@ -22,8 +22,13 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
22
22
|
Classifier: Topic :: System :: Systems Administration
|
|
23
23
|
Classifier: Typing :: Typed
|
|
24
24
|
Requires-Python: >=3.11
|
|
25
|
+
Requires-Dist: plyer
|
|
25
26
|
Requires-Dist: psutil>=6.0.0
|
|
27
|
+
Requires-Dist: pulumi-command>=1.3.0
|
|
28
|
+
Requires-Dist: pulumi>=3.277.0
|
|
26
29
|
Requires-Dist: pycaw>=20240210; sys_platform == 'win32'
|
|
30
|
+
Requires-Dist: pyperclip
|
|
31
|
+
Requires-Dist: qrcode[pil]>=8.0
|
|
27
32
|
Requires-Dist: rich>=13.7.0
|
|
28
33
|
Requires-Dist: typer>=0.12.0
|
|
29
34
|
Provides-Extra: dev
|
|
@@ -36,7 +41,7 @@ Description-Content-Type: text/markdown
|
|
|
36
41
|
|
|
37
42
|
# OptForge
|
|
38
43
|
|
|
39
|
-
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.
|
|
40
45
|
|
|
41
46
|
Built with Python, Typer, and Rich.
|
|
42
47
|
|
|
@@ -54,6 +59,8 @@ It helps you:
|
|
|
54
59
|
- remove stale Python cache artifacts from local projects, without scanning `venv` or `.venv`
|
|
55
60
|
- get, set, mute, and adjust the default output volume
|
|
56
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
|
|
57
64
|
|
|
58
65
|
## Why use OptForge?
|
|
59
66
|
|
|
@@ -106,6 +113,23 @@ Most tools are designed to be simple, fast, and cross-platform; `killNotif` is W
|
|
|
106
113
|
- requires Windows 10/11 and Windows PowerShell 5.1+
|
|
107
114
|
- not available on macOS or Linux; the command exits with code `3` there
|
|
108
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
|
+
|
|
109
133
|
## Installation
|
|
110
134
|
|
|
111
135
|
Python 3.11 or newer is required.
|
|
@@ -145,6 +169,8 @@ pycache-clean --help
|
|
|
145
169
|
vol --help
|
|
146
170
|
killNotif --help # Windows 10/11 only
|
|
147
171
|
optforge killNotif --help
|
|
172
|
+
ranpass --help
|
|
173
|
+
qrme --help
|
|
148
174
|
```
|
|
149
175
|
|
|
150
176
|
## Platform support
|
|
@@ -153,6 +179,8 @@ optforge killNotif --help
|
|
|
153
179
|
| --- | --- | --- | --- |
|
|
154
180
|
| `portcheck`, `envcheck`, `diskcheck`, `pycache-clean` | Yes | Yes | Yes |
|
|
155
181
|
| `vol` | Yes | Yes | Yes |
|
|
182
|
+
| `ranpass` | Yes | Yes | Yes |
|
|
183
|
+
| `qrme` | Yes | Yes | Yes |
|
|
156
184
|
| `killNotif` | Windows 10/11 only | No | No |
|
|
157
185
|
|
|
158
186
|
`vol` uses the system mixer: Core Audio on Windows, `osascript` on macOS, and `pactl`/`wpctl`/`amixer` on Linux.
|
|
@@ -232,6 +260,31 @@ killNotif --quiet
|
|
|
232
260
|
|
|
233
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.
|
|
234
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
|
+
|
|
235
288
|
## Project structure
|
|
236
289
|
|
|
237
290
|
```text
|
|
@@ -244,6 +297,8 @@ OptForge/
|
|
|
244
297
|
│ ├── killNotif/
|
|
245
298
|
│ ├── portcheck/
|
|
246
299
|
│ ├── pycacheclean/
|
|
300
|
+
│ ├── qrme/
|
|
301
|
+
│ ├── ranpass/
|
|
247
302
|
│ └── volume/
|
|
248
303
|
├── Makefile
|
|
249
304
|
├── README.md
|
|
@@ -275,6 +330,8 @@ make test
|
|
|
275
330
|
- pycaw for `vol` on Windows (installed automatically)
|
|
276
331
|
- `pactl`, `wpctl`, or `amixer` for `vol` on Linux
|
|
277
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)
|
|
278
335
|
|
|
279
336
|
All other commands work on Windows, macOS, and Linux.
|
|
280
337
|
|
|
@@ -294,4 +351,4 @@ MIT. See [LICENSE](LICENSE).
|
|
|
294
351
|
|
|
295
352
|
## Summary
|
|
296
353
|
|
|
297
|
-
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.
|
|
@@ -27,9 +27,14 @@ classifiers = [
|
|
|
27
27
|
]
|
|
28
28
|
dependencies = [
|
|
29
29
|
"psutil>=6.0.0",
|
|
30
|
+
"pulumi>=3.277.0",
|
|
31
|
+
"pulumi-command>=1.3.0",
|
|
30
32
|
"pycaw>=20240210; sys_platform == 'win32'",
|
|
31
33
|
"rich>=13.7.0",
|
|
32
34
|
"typer>=0.12.0",
|
|
35
|
+
"pyperclip",
|
|
36
|
+
"plyer",
|
|
37
|
+
"qrcode[pil]>=8.0",
|
|
33
38
|
]
|
|
34
39
|
|
|
35
40
|
[project.optional-dependencies]
|
|
@@ -50,6 +55,8 @@ pycache-clean = "optforge.pycacheclean.cli:app"
|
|
|
50
55
|
pycacheClean = "optforge.pycacheclean.cli:app"
|
|
51
56
|
killNotif = "optforge.killNotif.cli:app"
|
|
52
57
|
vol = "optforge.volume.cli:app"
|
|
58
|
+
ranpass = "optforge.ranpass.ranpass:main"
|
|
59
|
+
qrme = "optforge.qrme.qrme:app"
|
|
53
60
|
|
|
54
61
|
[project.urls]
|
|
55
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
|
-
|
|
16
|
+
from optforge.qrme.qrme import app as qr_app
|
|
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, 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"]},
|
|
@@ -52,7 +53,7 @@ app.add_typer(pycacheclean_app, name="pycache-clean")
|
|
|
52
53
|
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
|
-
|
|
56
|
+
app.add_typer(ran_app, name="ranpas")
|
|
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()
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import random
|
|
2
|
+
import secrets
|
|
3
|
+
import string as st
|
|
4
|
+
from typing import Annotated
|
|
5
|
+
from typer import Typer, Argument, Option, echo, Exit, run
|
|
6
|
+
from plyer import notification
|
|
7
|
+
from rich.text import Text
|
|
8
|
+
import pyperclip as pyp
|
|
9
|
+
from rich.console import Console
|
|
10
|
+
from rich.theme import Theme
|
|
11
|
+
from sys import platform
|
|
12
|
+
|
|
13
|
+
app = Typer(
|
|
14
|
+
name="RanPass",
|
|
15
|
+
no_args_is_help=True,
|
|
16
|
+
help="Get your password in a sec!; Run 'ranpass --help' for more."
|
|
17
|
+
)
|
|
18
|
+
# We relized that GC gets ride of any objec in python if there is not ref for it.
|
|
19
|
+
custom_theme = Theme({
|
|
20
|
+
"ok": "bold green",
|
|
21
|
+
"warn": "yellow",
|
|
22
|
+
"err": "bold red",
|
|
23
|
+
"dim": "grey50"
|
|
24
|
+
})
|
|
25
|
+
console = Console(theme=custom_theme)
|
|
26
|
+
@app.command("--help")
|
|
27
|
+
|
|
28
|
+
@app.command("help")
|
|
29
|
+
def show_help():
|
|
30
|
+
console.print()
|
|
31
|
+
|
|
32
|
+
title = Text("RANPASS", style="bold bright_cyan")
|
|
33
|
+
title.append(" | Password Generator", style="bold white")
|
|
34
|
+
|
|
35
|
+
console.print(
|
|
36
|
+
Panel(
|
|
37
|
+
"[bold white]Generate secure passwords in seconds![/bold white]\n"
|
|
38
|
+
"[dim]Simple • Fast • Customizable • Clipboard Ready[/dim]",
|
|
39
|
+
title=title,
|
|
40
|
+
border_style="bright_cyan",
|
|
41
|
+
padding=(1, 3),
|
|
42
|
+
)
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
table = Table(
|
|
47
|
+
title="COMMAND OPTIONS",
|
|
48
|
+
box=box.ROUNDED,
|
|
49
|
+
border_style="bright_blue",
|
|
50
|
+
header_style="bold bright_cyan",
|
|
51
|
+
show_lines=True
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
table.add_column("Option", style="bold green")
|
|
55
|
+
table.add_column("Short", style="yellow")
|
|
56
|
+
table.add_column("Description", style="white")
|
|
57
|
+
|
|
58
|
+
table.add_row("--letter", "-l", "Include lowercase letters")
|
|
59
|
+
table.add_row("--number", "-n", "Include numbers")
|
|
60
|
+
table.add_row("--stuff", "-s", "Include special characters")
|
|
61
|
+
table.add_row("--min", "", "Set minimum password length (default: 8)")
|
|
62
|
+
table.add_row("--max", "", "Set maximum password length (default: 16)")
|
|
63
|
+
|
|
64
|
+
console.print(table)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
examples = Table(
|
|
68
|
+
title="EXAMPLES",
|
|
69
|
+
box=box.SIMPLE,
|
|
70
|
+
show_header=False,
|
|
71
|
+
padding=(0, 2)
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
examples.add_column("Command", style="bold green")
|
|
75
|
+
examples.add_column("Description", style="white")
|
|
76
|
+
|
|
77
|
+
examples.add_row("ranpass 12", "Generate a 12-character password")
|
|
78
|
+
examples.add_row("ranpass 16 -l", "Include lowercase letters")
|
|
79
|
+
examples.add_row("ranpass 12 -n", "Include numbers")
|
|
80
|
+
examples.add_row("ranpass 16 -s", "Include special characters")
|
|
81
|
+
examples.add_row("ranpass 12 -l -n -s", "Include all selected character types")
|
|
82
|
+
|
|
83
|
+
console.print(examples)
|
|
84
|
+
|
|
85
|
+
console.print(
|
|
86
|
+
Panel(
|
|
87
|
+
"[bold green]Your password is automatically copied to your clipboard![/bold green]\n"
|
|
88
|
+
"[dim]Use --help for command-specific information.[/dim]",
|
|
89
|
+
border_style="green",
|
|
90
|
+
padding=(1, 2)
|
|
91
|
+
)
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
console.print("[dim]RanPass • Made with Python[/dim]", justify="center")
|
|
95
|
+
|
|
96
|
+
def _swap_end(passw: str) -> str:
|
|
97
|
+
first, rest, last = passw[0], passw[1:-1], passw[-1]
|
|
98
|
+
rest = "*" * (len(passw) - 2)
|
|
99
|
+
res = first + rest + last
|
|
100
|
+
return res
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
@app.command()
|
|
104
|
+
def ranpass(
|
|
105
|
+
length: Annotated[int | None, Argument(help="Length of the password")] = None,
|
|
106
|
+
letter: Annotated[bool, Option("--letter", "-l", help="Include letters")] = False,
|
|
107
|
+
number: Annotated[bool, Option("--number", "-n", help="Include numbers")] = False,
|
|
108
|
+
signs: Annotated[bool, Option("--stuff", "-s", help="Include Signse.g. #@%!*/\\")] = False,
|
|
109
|
+
min_len: Annotated[int, Option("--min", help="Minimum password length")] = 5,
|
|
110
|
+
max_len: Annotated[int, Option("--max", help="Maximum password length")] = 20,
|
|
111
|
+
):
|
|
112
|
+
if min_len > max_len:
|
|
113
|
+
console.print("[bold red]Error:[/bold red] --min cannot be greater than --max.", style="err")
|
|
114
|
+
raise Exit(code=1)
|
|
115
|
+
|
|
116
|
+
if length is not None and (length < min_len or length > max_len):
|
|
117
|
+
console.print(f"[bold red]Length must be between {min_len} and {max_len}.[/bold red]")
|
|
118
|
+
raise Exit(code=1)
|
|
119
|
+
chars = ""
|
|
120
|
+
if length is None:
|
|
121
|
+
length = random.randint(min_len, max_len)
|
|
122
|
+
if letter:
|
|
123
|
+
chars += st.ascii_lowercase
|
|
124
|
+
if number:
|
|
125
|
+
chars += st.digits
|
|
126
|
+
if signs:
|
|
127
|
+
chars += st.punctuation
|
|
128
|
+
if not chars:
|
|
129
|
+
chars = st.ascii_letters + st.digits + st.punctuation
|
|
130
|
+
|
|
131
|
+
password = "".join(secrets.choice(chars) for _ in range(length))
|
|
132
|
+
echo(_swap_end(password))
|
|
133
|
+
shortcut = {
|
|
134
|
+
'win32': "win + v",
|
|
135
|
+
"linux": "ctrl + shift + v",
|
|
136
|
+
"darwin": "command + v",
|
|
137
|
+
}
|
|
138
|
+
cmd = shortcut.get(platform, "ctrl + v")
|
|
139
|
+
pyp.copy(password)
|
|
140
|
+
notification.notify(title="Password Copied!", message=_swap_end(password), app_name="Python", timeout=4)
|
|
141
|
+
|
|
142
|
+
console.print(f"Copied Password to Clipboard. Paste with {cmd}.", style="ok")
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def main() -> None:
|
|
146
|
+
run(ranpass)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
if __name__ == "__main__":
|
|
150
|
+
main()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.3.10"
|
|
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
|