krz/yoshi-cli

A password manager for the command line.

clone: git clone https://gitbay.org/krz/yoshi-cli.git

6dde4dd0bc5e5f91f89587c75a30c9ef7a24494c

verified · cmc

author: Christian Cleberg <hello@cleberg.net> · 2024-11-07T05:23:27Z

package as a cli app
 .gitignore                                          |  1 +
 README.md                                           |  5 ++---
 pyproject.toml                                      |  5 ++++-
 requirements.txt                                    |  2 +-
 src/yoshi_cli.egg-info/SOURCES.txt                  | 11 -----------
 src/yoshi_cli.egg-info/top_level.txt                |  4 ----
 yoshi/__init__.py                                   |  0
 yoshi/__main__.py                                   |  3 +++
 {src => yoshi}/account.py                           |  2 +-
 main.py => yoshi/cli.py                             | 11 +++++++----
 {src => yoshi}/crypto.py                            |  0
 {src => yoshi}/database.py                          |  0
 {src => yoshi}/process.py                           |  7 ++++---
 .../PKG-INFO                                        | 21 ++++++++++-----------
 yoshi_cli.egg-info/SOURCES.txt                      | 15 +++++++++++++++
 .../dependency_links.txt                            |  0
 yoshi_cli.egg-info/entry_points.txt                 |  2 ++
 yoshi_cli.egg-info/top_level.txt                    |  1 +
 18 files changed, 51 insertions(+), 39 deletions(-)

diff --git a/.gitignore b/.gitignore
index a284724..0f74d83 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
 .DS_Store
 .idea/
 .pypirc
+build/
 dist/
 venv/
 __pycache__/
diff --git a/README.md b/README.md
index f6ae396..8c04013 100644
--- a/README.md
+++ b/README.md
@@ -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>`
 
 ![Yoshi CLI Help](./examples/yoshi-help.png)
 
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
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
similarity index 97%
rename from src/account.py
rename to 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:
diff --git a/main.py b/yoshi/cli.py
similarity index 96%
rename from main.py
rename to yoshi/cli.py
index 913103d..56abae7 100644
--- a/main.py
+++ b/yoshi/cli.py
@@ -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
similarity index 100%
rename from src/crypto.py
rename to yoshi/crypto.py
diff --git a/src/database.py b/yoshi/database.py
similarity index 100%
rename from src/database.py
rename to yoshi/database.py
diff --git a/src/process.py b/yoshi/process.py
similarity index 97%
rename from src/process.py
rename to 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
similarity index 96%
rename from src/yoshi_cli.egg-info/PKG-INFO
rename to 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>`
 
 ![Yoshi CLI Help](./examples/yoshi-help.png)
 
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
similarity index 100%
rename from src/yoshi_cli.egg-info/dependency_links.txt
rename to 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