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 | 1 | .DS_Store |
| 2 | 2 | .idea/ |
| 3 | 3 | .pypirc |
| 4 | build/ |
| 4 | 5 | dist/ |
| 5 | 6 | venv/ |
| 6 | 7 | __pycache__/ |
README.md
+2 −3
| @@ -34,8 +34,7 @@ To run the script locally, run the following commands: |
| 34 | 34 | ```bash |
| 35 | 35 | git clone REPO_URL |
| 36 | 36 | cd yoshi |
| 37 | | pip3 install -r requirements.txt |
| 38 | | python3 main.py --help |
| 37 | pip install . |
| 39 | 38 | ``` |
| 40 | 39 | |
| 41 | 40 | # Usage |
| @@ -43,7 +42,7 @@ python3 main.py --help |
| 43 | 42 | [(Back to top)](#table-of-contents) |
| 44 | 43 | |
| 45 | 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 | 1 | [project] |
| 2 | 2 | name = "yoshi-cli" |
| 3 | | version = "0.1.0" |
| 3 | version = "0.1.1" |
| 4 | 4 | authors = [ |
| 5 | 5 | { name="Christian Cleberg", email="hello@cleberg.net" }, |
| 6 | 6 | ] |
| @@ -16,3 +16,6 @@ classifiers = [ |
| 16 | 16 | [project.urls] |
| 17 | 17 | Homepage = "https://github.com/ccleberg/yoshi" |
| 18 | 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 | 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 | 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 | 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 | 7 | import argparse |
| 8 | | import crypto |
| 9 | | import database |
| 10 | | import process |
| 8 | import yoshi.crypto as crypto |
| 9 | import yoshi.database as database |
| 10 | import yoshi.process as process |
| 11 | 11 | |
| 12 | | if __name__ == '__main__': |
| 12 | def yoshi(): |
| 13 | 13 | parser = argparse.ArgumentParser( |
| 14 | 14 | description='Manage your username and passwords via a convenient CLI vault.' |
| 15 | 15 | ) |
| @@ -131,3 +131,6 @@ if __name__ == '__main__': |
| 131 | 131 | raise TypeError( |
| 132 | 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 | 27 | import random |
| 28 | 28 | import uuid |
| 29 | 29 | from prettytable import PrettyTable |
| 30 | | from account import Account |
| 31 | | import database |
| 30 | from yoshi.account import Account |
| 31 | import yoshi.database as database |
| 32 | 32 | |
| 33 | 33 | |
| 34 | 34 | def generate_characters(n: int) -> list: |
| @@ -176,7 +176,8 @@ def create_account() -> None: |
| 176 | 176 | if password_length < 8: |
| 177 | 177 | print('Error: Your password length must be at least 8 characters.') |
| 178 | 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 | 181 | else: |
| 181 | 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 | 1 | Metadata-Version: 2.1 |
| 2 | 2 | Name: yoshi-cli |
| 3 | | Version: 0.1.0 |
| 3 | Version: 0.1.1 |
| 4 | 4 | Summary: A password manager for the command line. |
| 5 | 5 | Author-email: Christian Cleberg <hello@cleberg.net> |
| 6 | 6 | Project-URL: Homepage, https://github.com/ccleberg/yoshi |
| @@ -35,22 +35,21 @@ information. |
| 35 | 35 | |
| 36 | 36 | [(Back to top)](#table-of-contents) |
| 37 | 37 | |
| 38 | | To run the script locally, run the following commands: |
| 38 | ## PyPi |
| 39 | 39 | |
| 40 | 40 | ```bash |
| 41 | | git clone REPO_URL |
| 41 | pip install yoshi-cli |
| 42 | 42 | ``` |
| 43 | 43 | |
| 44 | | ```bash |
| 45 | | cd yoshi |
| 46 | | ``` |
| 44 | ## Manual |
| 47 | 45 | |
| 48 | | ```bash |
| 49 | | pip3 install -r requirements.txt |
| 50 | | ``` |
| 46 | To run the script locally, run the following commands: |
| 51 | 47 | |
| 52 | 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 | 55 | # Usage |
| @@ -58,7 +57,7 @@ python3 main.py --help |
| 58 | 57 | [(Back to top)](#table-of-contents) |
| 59 | 58 | |
| 60 | 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