diff options
author | Christian Cleberg <hello@cleberg.net> | 2024-11-06 23:23:27 -0600 |
---|---|---|
committer | Christian Cleberg <hello@cleberg.net> | 2024-11-06 23:23:27 -0600 |
commit | 6dde4dd0bc5e5f91f89587c75a30c9ef7a24494c (patch) | |
tree | 6cf4b78ddd63a4606e19fcad423ed2e19ad2a268 | |
parent | b5a5fadff88615c8da8a9feb80c86fd8adb238f5 (diff) | |
download | yoshi-cli-6dde4dd0bc5e5f91f89587c75a30c9ef7a24494c.tar.gz yoshi-cli-6dde4dd0bc5e5f91f89587c75a30c9ef7a24494c.tar.bz2 yoshi-cli-6dde4dd0bc5e5f91f89587c75a30c9ef7a24494c.zip |
package as a cli app
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | README.md | 5 | ||||
-rw-r--r-- | pyproject.toml | 5 | ||||
-rw-r--r-- | requirements.txt | 2 | ||||
-rw-r--r-- | src/yoshi_cli.egg-info/SOURCES.txt | 11 | ||||
-rw-r--r-- | src/yoshi_cli.egg-info/top_level.txt | 4 | ||||
-rw-r--r-- | yoshi/__init__.py | 0 | ||||
-rw-r--r-- | yoshi/__main__.py | 3 | ||||
-rw-r--r-- | yoshi/account.py (renamed from src/account.py) | 2 | ||||
-rw-r--r-- | yoshi/cli.py (renamed from main.py) | 11 | ||||
-rw-r--r-- | yoshi/crypto.py (renamed from src/crypto.py) | 0 | ||||
-rw-r--r-- | yoshi/database.py (renamed from src/database.py) | 0 | ||||
-rw-r--r-- | yoshi/process.py (renamed from src/process.py) | 7 | ||||
-rw-r--r-- | yoshi_cli.egg-info/PKG-INFO (renamed from src/yoshi_cli.egg-info/PKG-INFO) | 21 | ||||
-rw-r--r-- | yoshi_cli.egg-info/SOURCES.txt | 15 | ||||
-rw-r--r-- | yoshi_cli.egg-info/dependency_links.txt (renamed from src/yoshi_cli.egg-info/dependency_links.txt) | 0 | ||||
-rw-r--r-- | yoshi_cli.egg-info/entry_points.txt | 2 | ||||
-rw-r--r-- | yoshi_cli.egg-info/top_level.txt | 1 |
18 files changed, 51 insertions, 39 deletions
@@ -1,6 +1,7 @@ .DS_Store .idea/ .pypirc +build/ dist/ venv/ __pycache__/ @@ -34,8 +34,7 @@ To run the script locally, run the following commands: ```bash git clone REPO_URL cd yoshi -pip3 install -r requirements.txt -python3 main.py --help +pip install . ``` # Usage @@ -43,7 +42,7 @@ python3 main.py --help [(Back to top)](#table-of-contents) All commands can be passed to the program with the following template: -`python3 main.py <COMMAND> <FLAG> <PARAMETER>` +`python3 src/yoshi/cli.py <COMMAND> <FLAG> <PARAMETER>`  diff --git a/pyproject.toml b/pyproject.toml index 43c4421..db6182d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "yoshi-cli" -version = "0.1.0" +version = "0.1.1" authors = [ { name="Christian Cleberg", email="hello@cleberg.net" }, ] @@ -16,3 +16,6 @@ classifiers = [ [project.urls] Homepage = "https://github.com/ccleberg/yoshi" Issues = "https://github.com/ccleberg/yoshi/issues" + +[project.scripts] +yoshi = "yoshi.cli:yoshi" diff --git a/requirements.txt b/requirements.txt index 5d49f4c..8c8473a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ prettytable~=2.2.0 -cryptography~=3.4.8
\ No newline at end of file +cryptography diff --git a/src/yoshi_cli.egg-info/SOURCES.txt b/src/yoshi_cli.egg-info/SOURCES.txt deleted file mode 100644 index c8ca832..0000000 --- a/src/yoshi_cli.egg-info/SOURCES.txt +++ /dev/null @@ -1,11 +0,0 @@ -LICENSE -README.md -pyproject.toml -src/account.py -src/crypto.py -src/database.py -src/process.py -src/yoshi_cli.egg-info/PKG-INFO -src/yoshi_cli.egg-info/SOURCES.txt -src/yoshi_cli.egg-info/dependency_links.txt -src/yoshi_cli.egg-info/top_level.txt
\ No newline at end of file diff --git a/src/yoshi_cli.egg-info/top_level.txt b/src/yoshi_cli.egg-info/top_level.txt deleted file mode 100644 index e855a8f..0000000 --- a/src/yoshi_cli.egg-info/top_level.txt +++ /dev/null @@ -1,4 +0,0 @@ -account -crypto -database -process diff --git a/yoshi/__init__.py b/yoshi/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/yoshi/__init__.py diff --git a/yoshi/__main__.py b/yoshi/__main__.py new file mode 100644 index 0000000..7cadd21 --- /dev/null +++ b/yoshi/__main__.py @@ -0,0 +1,3 @@ +if __name__ == "__main__": + from yoshi.cli import yoshi + yoshi() diff --git a/src/account.py b/yoshi/account.py index 79fcc13..bf97c23 100644 --- a/src/account.py +++ b/yoshi/account.py @@ -5,7 +5,7 @@ Modules imported: - database: A custom module providing database functionality. """ -import database +import yoshi.database as database class Account: @@ -5,11 +5,11 @@ It imports the required modules and sets up a parser with basic options for demo """ import argparse -import crypto -import database -import process +import yoshi.crypto as crypto +import yoshi.database as database +import yoshi.process as process -if __name__ == '__main__': +def yoshi(): parser = argparse.ArgumentParser( description='Manage your username and passwords via a convenient CLI vault.' ) @@ -131,3 +131,6 @@ if __name__ == '__main__': raise TypeError( 'Please specify a command or use the --help flag for more information.' ) + +if __name__ == "__main__": + yoshi() diff --git a/src/crypto.py b/yoshi/crypto.py index 9b0a423..9b0a423 100644 --- a/src/crypto.py +++ b/yoshi/crypto.py diff --git a/src/database.py b/yoshi/database.py index e1e2e78..e1e2e78 100644 --- a/src/database.py +++ b/yoshi/database.py diff --git a/src/process.py b/yoshi/process.py index 0888a78..155f9b0 100644 --- a/src/process.py +++ b/yoshi/process.py @@ -27,8 +27,8 @@ from string import ascii_letters, punctuation, digits import random import uuid from prettytable import PrettyTable -from account import Account -import database +from yoshi.account import Account +import yoshi.database as database def generate_characters(n: int) -> list: @@ -176,7 +176,8 @@ def create_account() -> None: if password_length < 8: print('Error: Your password length must be at least 8 characters.') return - password_string = generate_password(password_length) # pylint: disable=undefined-variable + password_characters = generate_characters(password_length) + password_string = shuffle_characters(password_characters) else: password_string = input('Please enter your desired password: ') diff --git a/src/yoshi_cli.egg-info/PKG-INFO b/yoshi_cli.egg-info/PKG-INFO index e545db5..085f3f6 100644 --- a/src/yoshi_cli.egg-info/PKG-INFO +++ b/yoshi_cli.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: yoshi-cli -Version: 0.1.0 +Version: 0.1.1 Summary: A password manager for the command line. Author-email: Christian Cleberg <hello@cleberg.net> Project-URL: Homepage, https://github.com/ccleberg/yoshi @@ -35,22 +35,21 @@ information. [(Back to top)](#table-of-contents) -To run the script locally, run the following commands: +## PyPi ```bash -git clone REPO_URL +pip install yoshi-cli ``` -```bash -cd yoshi -``` +## Manual -```bash -pip3 install -r requirements.txt -``` +To run the script locally, run the following commands: ```bash -python3 main.py --help +git clone REPO_URL +cd yoshi +pip3 install -r requirements.txt +python3 src/yoshi/cli.py --help ``` # Usage @@ -58,7 +57,7 @@ python3 main.py --help [(Back to top)](#table-of-contents) All commands can be passed to the program with the following template: -`python3 main.py <COMMAND> <FLAG> <PARAMETER>` +`python3 src/yoshi/cli.py <COMMAND> <FLAG> <PARAMETER>`  diff --git a/yoshi_cli.egg-info/SOURCES.txt b/yoshi_cli.egg-info/SOURCES.txt new file mode 100644 index 0000000..62143a6 --- /dev/null +++ b/yoshi_cli.egg-info/SOURCES.txt @@ -0,0 +1,15 @@ +LICENSE +README.md +pyproject.toml +yoshi/__init__.py +yoshi/__main__.py +yoshi/account.py +yoshi/cli.py +yoshi/crypto.py +yoshi/database.py +yoshi/process.py +yoshi_cli.egg-info/PKG-INFO +yoshi_cli.egg-info/SOURCES.txt +yoshi_cli.egg-info/dependency_links.txt +yoshi_cli.egg-info/entry_points.txt +yoshi_cli.egg-info/top_level.txt
\ No newline at end of file diff --git a/src/yoshi_cli.egg-info/dependency_links.txt b/yoshi_cli.egg-info/dependency_links.txt index 8b13789..8b13789 100644 --- a/src/yoshi_cli.egg-info/dependency_links.txt +++ b/yoshi_cli.egg-info/dependency_links.txt diff --git a/yoshi_cli.egg-info/entry_points.txt b/yoshi_cli.egg-info/entry_points.txt new file mode 100644 index 0000000..cb6e7c1 --- /dev/null +++ b/yoshi_cli.egg-info/entry_points.txt @@ -0,0 +1,2 @@ +[console_scripts] +yoshi = yoshi.cli:yoshi diff --git a/yoshi_cli.egg-info/top_level.txt b/yoshi_cli.egg-info/top_level.txt new file mode 100644 index 0000000..017a863 --- /dev/null +++ b/yoshi_cli.egg-info/top_level.txt @@ -0,0 +1 @@ +yoshi |