Commit 6dde4dd0bc
6dde4dd0bc5e5f91f89587c75a30c9ef7a24494c
parent: b5a5fadff8
Verified · cmc
cmc <hello@cleberg.net> · 2024-11-07 05:23 UTC
package as a cli app
Layout: unified · split
.gitignore
+1
| @@ -1,6 +1,7 @@ |
| 1 | .DS_Store |
1 | .DS_Store |
| 2 | .idea/ |
2 | .idea/ |
| 3 | .pypirc |
3 | .pypirc |
| |
4 | build/ |
| 4 | dist/ |
5 | dist/ |
| 5 | venv/ |
6 | venv/ |
| 6 | __pycache__/ |
7 | __pycache__/ |
README.md
+2 −3
| @@ -34,8 +34,7 @@ To run the script locally, run the following commands: |
| 34 | ```bash |
34 | ```bash |
| 35 | git clone REPO_URL |
35 | git clone REPO_URL |
| 36 | cd yoshi |
36 | cd yoshi |
| 37 | pip3 install -r requirements.txt |
37 | pip install . |
| 38 | python3 main.py --help |
| |
| 39 | ``` |
38 | ``` |
| 40 | |
39 | |
| 41 | # Usage |
40 | # Usage |
| @@ -43,7 +42,7 @@ python3 main.py --help |
| 43 | [(Back to top)](#table-of-contents) |
42 | [(Back to top)](#table-of-contents) |
| 44 | |
43 | |
| 45 | All commands can be passed to the program with the following template: |
44 | All commands can be passed to the program with the following template: |
| 46 | `python3 main.py <COMMAND> <FLAG> <PARAMETER>` |
45 | `python3 src/yoshi/cli.py <COMMAND> <FLAG> <PARAMETER>` |
| 47 | |
46 | |
| 48 |  |
47 |  |
| 49 | |
48 | |
pyproject.toml
+4 −1
| @@ -1,6 +1,6 @@ |
| 1 | [project] |
1 | [project] |
| 2 | name = "yoshi-cli" |
2 | name = "yoshi-cli" |
| 3 | version = "0.1.0" |
3 | version = "0.1.1" |
| 4 | authors = [ |
4 | authors = [ |
| 5 | { name="Christian Cleberg", email="hello@cleberg.net" }, |
5 | { name="Christian Cleberg", email="hello@cleberg.net" }, |
| 6 | ] |
6 | ] |
| @@ -16,3 +16,6 @@ classifiers = [ |
| 16 | [project.urls] |
16 | [project.urls] |
| 17 | Homepage = "https://github.com/ccleberg/yoshi" |
17 | Homepage = "https://github.com/ccleberg/yoshi" |
| 18 | Issues = "https://github.com/ccleberg/yoshi/issues" |
18 | Issues = "https://github.com/ccleberg/yoshi/issues" |
| |
19 | |
| |
20 | [project.scripts] |
| |
21 | yoshi = "yoshi.cli:yoshi" |
requirements.txt
+1 −1
| @@ -1,2 +1,2 @@ |
| 1 | prettytable~=2.2.0 |
1 | prettytable~=2.2.0 |
| 2 | cryptography~=3.4.8\ No newline at end of file |
2 | cryptography |
src/yoshi_cli.egg-info/SOURCES.txt
deleted
−11
| @@ -1,11 +0,0 @@ |
| 1 | LICENSE |
| |
| 2 | README.md |
| |
| 3 | pyproject.toml |
| |
| 4 | src/account.py |
| |
| 5 | src/crypto.py |
| |
| 6 | src/database.py |
| |
| 7 | src/process.py |
| |
| 8 | src/yoshi_cli.egg-info/PKG-INFO |
| |
| 9 | src/yoshi_cli.egg-info/SOURCES.txt |
| |
| 10 | src/yoshi_cli.egg-info/dependency_links.txt |
| |
| 11 | src/yoshi_cli.egg-info/top_level.txt\ No newline at end of file |
| |
src/yoshi_cli.egg-info/top_level.txt
deleted
−4
| @@ -1,4 +0,0 @@ |
| 1 | account |
| |
| 2 | crypto |
| |
| 3 | database |
| |
| 4 | process |
| |
yoshi/__init__.py
added
yoshi/__main__.py
added
+3
| @@ -0,0 +1,3 @@ |
| |
1 | if __name__ == "__main__": |
| |
2 | from yoshi.cli import yoshi |
| |
3 | yoshi() |
src/account.py → yoshi/account.py
renamed
+1 −1
| @@ -5,7 +5,7 @@ Modules imported: |
| 5 | - database: A custom module providing database functionality. |
5 | - database: A custom module providing database functionality. |
| 6 | """ |
6 | """ |
| 7 | |
7 | |
| 8 | import database |
8 | import yoshi.database as database |
| 9 | |
9 | |
| 10 | |
10 | |
| 11 | class Account: |
11 | class Account: |
main.py → yoshi/cli.py
renamed
+7 −4
| @@ -5,11 +5,11 @@ It imports the required modules and sets up a parser with basic options for demo |
| 5 | """ |
5 | """ |
| 6 | |
6 | |
| 7 | import argparse |
7 | import argparse |
| 8 | import crypto |
8 | import yoshi.crypto as crypto |
| 9 | import database |
9 | import yoshi.database as database |
| 10 | import process |
10 | import yoshi.process as process |
| 11 | |
11 | |
| 12 | if __name__ == '__main__': |
12 | def yoshi(): |
| 13 | parser = argparse.ArgumentParser( |
13 | parser = argparse.ArgumentParser( |
| 14 | description='Manage your username and passwords via a convenient CLI vault.' |
14 | description='Manage your username and passwords via a convenient CLI vault.' |
| 15 | ) |
15 | ) |
| @@ -131,3 +131,6 @@ if __name__ == '__main__': |
| 131 | raise TypeError( |
131 | raise TypeError( |
| 132 | 'Please specify a command or use the --help flag for more information.' |
132 | 'Please specify a command or use the --help flag for more information.' |
| 133 | ) |
133 | ) |
| |
134 | |
| |
135 | if __name__ == "__main__": |
| |
136 | yoshi() |
src/crypto.py → yoshi/crypto.py
renamed
src/database.py → yoshi/database.py
renamed
src/process.py → yoshi/process.py
renamed
+4 −3
| @@ -27,8 +27,8 @@ from string import ascii_letters, punctuation, digits |
| 27 | import random |
27 | import random |
| 28 | import uuid |
28 | import uuid |
| 29 | from prettytable import PrettyTable |
29 | from prettytable import PrettyTable |
| 30 | from account import Account |
30 | from yoshi.account import Account |
| 31 | import database |
31 | import yoshi.database as database |
| 32 | |
32 | |
| 33 | |
33 | |
| 34 | def generate_characters(n: int) -> list: |
34 | def generate_characters(n: int) -> list: |
| @@ -176,7 +176,8 @@ def create_account() -> None: |
| 176 | if password_length < 8: |
176 | if password_length < 8: |
| 177 | print('Error: Your password length must be at least 8 characters.') |
177 | print('Error: Your password length must be at least 8 characters.') |
| 178 | return |
178 | return |
| 179 | password_string = generate_password(password_length) # pylint: disable=undefined-variable |
179 | password_characters = generate_characters(password_length) |
| |
180 | password_string = shuffle_characters(password_characters) |
| 180 | else: |
181 | else: |
| 181 | password_string = input('Please enter your desired password: ') |
182 | password_string = input('Please enter your desired password: ') |
| 182 | |
183 | |
src/yoshi_cli.egg-info/PKG-INFO → yoshi_cli.egg-info/PKG-INFO
renamed
+10 −11
| @@ -1,6 +1,6 @@ |
| 1 | Metadata-Version: 2.1 |
1 | Metadata-Version: 2.1 |
| 2 | Name: yoshi-cli |
2 | Name: yoshi-cli |
| 3 | Version: 0.1.0 |
3 | Version: 0.1.1 |
| 4 | Summary: A password manager for the command line. |
4 | Summary: A password manager for the command line. |
| 5 | Author-email: Christian Cleberg <hello@cleberg.net> |
5 | Author-email: Christian Cleberg <hello@cleberg.net> |
| 6 | Project-URL: Homepage, https://github.com/ccleberg/yoshi |
6 | Project-URL: Homepage, https://github.com/ccleberg/yoshi |
| @@ -35,22 +35,21 @@ information. |
| 35 | |
35 | |
| 36 | [(Back to top)](#table-of-contents) |
36 | [(Back to top)](#table-of-contents) |
| 37 | |
37 | |
| 38 | To run the script locally, run the following commands: |
38 | ## PyPi |
| 39 | |
39 | |
| 40 | ```bash |
40 | ```bash |
| 41 | git clone REPO_URL |
41 | pip install yoshi-cli |
| 42 | ``` |
42 | ``` |
| 43 | |
43 | |
| 44 | ```bash |
44 | ## Manual |
| 45 | cd yoshi |
| |
| 46 | ``` |
| |
| 47 | |
45 | |
| 48 | ```bash |
46 | To run the script locally, run the following commands: |
| 49 | pip3 install -r requirements.txt |
| |
| 50 | ``` |
| |
| 51 | |
47 | |
| 52 | ```bash |
48 | ```bash |
| 53 | python3 main.py --help |
49 | git clone REPO_URL |
| |
50 | cd yoshi |
| |
51 | pip3 install -r requirements.txt |
| |
52 | python3 src/yoshi/cli.py --help |
| 54 | ``` |
53 | ``` |
| 55 | |
54 | |
| 56 | # Usage |
55 | # Usage |
| @@ -58,7 +57,7 @@ python3 main.py --help |
| 58 | [(Back to top)](#table-of-contents) |
57 | [(Back to top)](#table-of-contents) |
| 59 | |
58 | |
| 60 | All commands can be passed to the program with the following template: |
59 | All commands can be passed to the program with the following template: |
| 61 | `python3 main.py <COMMAND> <FLAG> <PARAMETER>` |
60 | `python3 src/yoshi/cli.py <COMMAND> <FLAG> <PARAMETER>` |
| 62 | |
61 | |
| 63 |  |
62 |  |
| 64 | |
63 | |
yoshi_cli.egg-info/SOURCES.txt
added
+15
| @@ -0,0 +1,15 @@ |
| |
1 | LICENSE |
| |
2 | README.md |
| |
3 | pyproject.toml |
| |
4 | yoshi/__init__.py |
| |
5 | yoshi/__main__.py |
| |
6 | yoshi/account.py |
| |
7 | yoshi/cli.py |
| |
8 | yoshi/crypto.py |
| |
9 | yoshi/database.py |
| |
10 | yoshi/process.py |
| |
11 | yoshi_cli.egg-info/PKG-INFO |
| |
12 | yoshi_cli.egg-info/SOURCES.txt |
| |
13 | yoshi_cli.egg-info/dependency_links.txt |
| |
14 | yoshi_cli.egg-info/entry_points.txt |
| |
15 | yoshi_cli.egg-info/top_level.txt\ No newline at end of file |
src/yoshi_cli.egg-info/dependency_links.txt → yoshi_cli.egg-info/dependency_links.txt
renamed
yoshi_cli.egg-info/entry_points.txt
added
+2
| @@ -0,0 +1,2 @@ |
| |
1 | [console_scripts] |
| |
2 | yoshi = yoshi.cli:yoshi |
yoshi_cli.egg-info/top_level.txt
added
+1