optforge 0.3.10__tar.gz → 0.3.11__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.11}/.gitignore +3 -0
- {optforge-0.3.10 → optforge-0.3.11}/PKG-INFO +5 -1
- {optforge-0.3.10 → optforge-0.3.11}/pyproject.toml +5 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/__main__.py +1 -0
- optforge-0.3.11/src/optforge/_version.py +1 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/cli.py +3 -3
- optforge-0.3.11/src/optforge/ranpass/ranpass.py +150 -0
- optforge-0.3.10/src/optforge/_version.py +0 -1
- {optforge-0.3.10 → optforge-0.3.11}/LICENSE +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/Makefile +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/README.md +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/__init__.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/core/__init__.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/core/cli.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/core/console.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/core/errors.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/core/formatting.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/core/net.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/core/processes.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/core/redaction.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/core/version.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/diskcheck/__init__.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/diskcheck/cli.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/diskcheck/models.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/diskcheck/service.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/envcheck/__init__.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/envcheck/cli.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/envcheck/models.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/envcheck/service.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/killNotif/__init__.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/killNotif/cli.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/killNotif/core.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/killNotif/job.ps1 +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/portcheck/__init__.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/portcheck/binder.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/portcheck/cli.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/portcheck/connector.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/portcheck/models.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/portcheck/scanner.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/portcheck/service.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/portcheck/waiter.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/py.typed +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/pycacheclean/__init__.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/pycacheclean/cleaner.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/pycacheclean/cli.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/pycacheclean/models.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/pycacheclean/scanner.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/pycacheclean/service.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/volume/__init__.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/volume/cli.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/src/optforge/volume/core.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/tests/test_cli.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/tests/test_console.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/tests/test_diskcheck.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/tests/test_envcheck.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/tests/test_formatting.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/tests/test_killnotif.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/tests/test_net.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/tests/test_portcheck.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/tests/test_processes.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/tests/test_pycacheclean.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/tests/test_redaction.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/tests/test_version.py +0 -0
- {optforge-0.3.10 → optforge-0.3.11}/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.11
|
|
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,12 @@ 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
|
|
27
31
|
Requires-Dist: rich>=13.7.0
|
|
28
32
|
Requires-Dist: typer>=0.12.0
|
|
29
33
|
Provides-Extra: dev
|
|
@@ -27,9 +27,13 @@ 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",
|
|
33
37
|
]
|
|
34
38
|
|
|
35
39
|
[project.optional-dependencies]
|
|
@@ -50,6 +54,7 @@ pycache-clean = "optforge.pycacheclean.cli:app"
|
|
|
50
54
|
pycacheClean = "optforge.pycacheclean.cli:app"
|
|
51
55
|
killNotif = "optforge.killNotif.cli:app"
|
|
52
56
|
vol = "optforge.volume.cli:app"
|
|
57
|
+
ranpass = "optforge.ranpass.ranpass:main"
|
|
53
58
|
|
|
54
59
|
[project.urls]
|
|
55
60
|
Homepage = "https://github.com/cmd-3324/OptForge"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.3.11"
|
|
@@ -13,10 +13,10 @@ 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.ranpass.ranpass import app as ran_app
|
|
17
17
|
app = typer.Typer(
|
|
18
18
|
name="optforge",
|
|
19
|
-
help="Developer utilities for ports, environment variables, disk usage, Python caches, and volume.",
|
|
19
|
+
help="Developer utilities for ports, environment variables, disk usage, Python caches, Random Password and volume.",
|
|
20
20
|
no_args_is_help=True,
|
|
21
21
|
rich_markup_mode="rich",
|
|
22
22
|
context_settings={"help_option_names": ["-h", "--help"]},
|
|
@@ -52,7 +52,7 @@ app.add_typer(pycacheclean_app, name="pycache-clean")
|
|
|
52
52
|
app.add_typer(pycacheclean_app, name="pycacheClean", hidden=True)
|
|
53
53
|
app.add_typer(killnotif_app, name="killNotif")
|
|
54
54
|
app.add_typer(volume_app, name="vol")
|
|
55
|
-
|
|
55
|
+
app.add_typer(ran_app, name="ranpas")
|
|
56
56
|
|
|
57
57
|
if __name__ == "__main__":
|
|
58
58
|
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
|
|
File without changes
|