From c27c349289e268a7355c139a7e926511b2b78140 Mon Sep 17 00:00:00 2001 From: Sanyam <259812796+Sny4m@users.noreply.github.com> Date: Mon, 20 Jul 2026 11:56:11 +0000 Subject: [PATCH 1/8] added a shop management system script --- Shop-Management-System/README.md | 122 ++++++++++++++ Shop-Management-System/buybye.py | 279 +++++++++++++++++++++++++++++++ 2 files changed, 401 insertions(+) create mode 100644 Shop-Management-System/README.md create mode 100644 Shop-Management-System/buybye.py diff --git a/Shop-Management-System/README.md b/Shop-Management-System/README.md new file mode 100644 index 0000000000..04573cc591 --- /dev/null +++ b/Shop-Management-System/README.md @@ -0,0 +1,122 @@ +# BuyBye + +A minimal CLI shop manager to track stock, sales, and more — no bloat, just works. + +--- + +## Installation + +1. Clone the repository: + ``` + git clone https://github.com/s4nyam07/BuyBye.git + ``` +3. Install dependency: + ``` + pip install pandas + ``` +4. Run the app, all required files are created automatically on first launch. + +--- + +## Usage + +### Windows + + python buybye.py + +or + + py buybye.py + +### Linux / Mac + + python3 buybye.py + +--- + +## Interface + +When you start the program, you’ll see: + +``` +██████╗ ██╗ ██╗██╗ ██╗██████╗ ██╗ ██╗███████╗ +██╔══██╗██║ ██║╚██╗ ██╔╝██╔══██╗╚██╗ ██╔╝██╔════╝ +██████╔╝██║ ██║ ╚████╔╝ ██████╔╝ ╚████╔╝ █████╗ +██╔══██╗██║ ██║ ╚██╔╝ ██╔══██╗ ╚██╔╝ ██╔══╝ +██████╔╝╚██████╔╝ ██║ ██████╔╝ ██║ ███████╗ +╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚══════╝ + +BuyBye + +1. Sales +2. Stock +3. Products +4. Employees +5. Liabilities +0. Exit +``` + +--- + +## Features + +### Sales +- Record new sales +- View all transactions + +### Stock +- Add or update product quantities +- Search items quickly + +### Products +- Add new products +- Update pricing + +### Employees +- Store employee details +- Filter by role + +### Liabilities +- Track dues and payments +- Add new entries + +### Auto Setup +- All required CSV files are created automatically +- No manual file handling needed + +--- + +## Files (Auto-Created) + +- `sales.csv` → sales records +- `stock.csv` → inventory +- `products.csv` → product list +- `employees.csv` → staff data +- `liabilities.csv` → liabilities + +--- + +## Example Workflow + +- Start BuyBye +- Add products +- Update stock +- Record sales +- Manage employees and liabilities + +--- + +## Why BuyBye? + +Because most tools are overcomplicated. + +BuyBye keeps it: +- simple +- fast +- easy to use + +--- + +## License + +This project is licensed under the MIT License. diff --git a/Shop-Management-System/buybye.py b/Shop-Management-System/buybye.py new file mode 100644 index 0000000000..4f2bda59d8 --- /dev/null +++ b/Shop-Management-System/buybye.py @@ -0,0 +1,279 @@ +import pandas as pd +import os +import time +from datetime import datetime + +login_time = datetime.now() + + +def clear(): + os.system('cls' if os.name == 'nt' else 'clear') + + +def header(): + print(r""" +██████╗ ██╗ ██╗██╗ ██╗██████╗ ██╗ ██╗███████╗ +██╔══██╗██║ ██║╚██╗ ██╔╝██╔══██╗╚██╗ ██╔╝██╔════╝ +██████╔╝██║ ██║ ╚████╔╝ ██████╔╝ ╚████╔╝ █████╗ +██╔══██╗██║ ██║ ╚██╔╝ ██╔══██╗ ╚██╔╝ ██╔══╝ +██████╔╝╚██████╔╝ ██║ ██████╔╝ ██║ ███████╗ +╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚══════╝ +""") + print("BuyBye\n") + + +def setup(): + files = { + "sales.csv": ["Item", "Qty", "Total"], + "stock.csv": ["Product", "Qty"], + "products.csv": ["Product", "Price"], + "employees.csv": ["Name", "Role"], + "liabilities.csv": ["Name", "Amount", "Due"], + "log.csv": ["Login Time", "Logout Time"] + } + + for f, cols in files.items(): + if not os.path.exists(f): + pd.DataFrame(columns=cols).to_csv(f, index=False) + + +def show_list(df, kind): + if df.empty: + print("No data found.\n") + return + + for i, row in df.iterrows(): + if kind == "sales": + print(f"{i+1}. {row['Item']} | Qty: {row['Qty']} | ₹{row['Total']}") + elif kind == "stock": + print(f"{i+1}. {row['Product']} | Qty: {row['Qty']}") + elif kind == "products": + print(f"{i+1}. {row['Product']} | ₹{row['Price']}") + elif kind == "employees": + print(f"{i+1}. {row['Name']} | {row['Role']}") + elif kind == "liab": + print(f"{i+1}. {row['Name']} | ₹{row['Amount']} | Due: {row['Due']}") + + +def exit_app(): + logout_time = datetime.now() + + log = pd.read_csv("log.csv") + log.loc[len(log)] = [login_time, logout_time] + log.to_csv("log.csv", index=False) + + clear() + header() + + for i in range(3): + print("Logging out" + "." * (i + 1)) + time.sleep(0.5) + clear() + header() + + print("\nSession saved ✔") + print("Bye 👋\n") + time.sleep(1) + + +def sales_menu(): + clear() + header() + df = pd.read_csv("sales.csv") + + print("SALES\n") + print("1. View") + print("2. Add") + + choice = input(">> ") + + if choice == "1": + clear() + header() + show_list(df, "sales") + input("\nEnter...") + + elif choice == "2": + item = input("Item: ") + qty = int(input("Qty: ")) + price = float(input("Price (₹): ")) + total = qty * price + + df.loc[len(df)] = [item, qty, total] + df.to_csv("sales.csv", index=False) + + print(f"Saved: ₹{total}") + input("Enter...") + + +def stock_menu(): + clear() + header() + df = pd.read_csv("stock.csv") + + print("STOCK\n") + print("1. View") + print("2. Add/Update") + print("3. Search") + + choice = input(">> ") + + if choice == "1": + clear() + header() + show_list(df, "stock") + input("\nEnter...") + + elif choice == "2": + name = input("Product: ") + qty = int(input("Qty: ")) + + if name in df["Product"].values: + df.loc[df["Product"] == name, "Qty"] = qty + else: + df.loc[len(df)] = [name, qty] + + df.to_csv("stock.csv", index=False) + print("Stock updated.") + input("Enter...") + + elif choice == "3": + name = input("Search: ") + clear() + header() + result = df[df["Product"].str.contains(name, case=False)] + show_list(result, "stock") + input("\nEnter...") + + +def product_menu(): + clear() + header() + df = pd.read_csv("products.csv") + + print("PRODUCTS\n") + print("1. View") + print("2. Add") + print("3. Change Price") + + choice = input(">> ") + + if choice == "1": + clear() + header() + show_list(df, "products") + input("\nEnter...") + + elif choice == "2": + name = input("Name: ") + price = float(input("Price (₹): ")) + df.loc[len(df)] = [name, price] + df.to_csv("products.csv", index=False) + print("Product added.") + input("Enter...") + + elif choice == "3": + name = input("Product: ") + price = float(input("New price (₹): ")) + df.loc[df["Product"] == name, "Price"] = price + df.to_csv("products.csv", index=False) + print("Price updated.") + input("Enter...") + + +def employee_menu(): + clear() + header() + df = pd.read_csv("employees.csv") + + print("EMPLOYEES\n") + print("1. View") + print("2. Add") + print("3. Filter") + + choice = input(">> ") + + if choice == "1": + clear() + header() + show_list(df, "employees") + input("\nEnter...") + + elif choice == "2": + name = input("Name: ") + role = input("Role: ") + df.loc[len(df)] = [name, role] + df.to_csv("employees.csv", index=False) + print("Employee added.") + input("Enter...") + + elif choice == "3": + role = input("Role: ") + clear() + header() + result = df[df["Role"].str.contains(role, case=False)] + show_list(result, "employees") + input("\nEnter...") + + +def liability_menu(): + clear() + header() + df = pd.read_csv("liabilities.csv") + + print("LIABILITIES\n") + print("1. View") + print("2. Add") + + choice = input(">> ") + + if choice == "1": + clear() + header() + show_list(df, "liab") + input("\nEnter...") + + elif choice == "2": + name = input("Name: ") + amt = float(input("Amount (₹): ")) + due = input("Due date: ") + + df.loc[len(df)] = [name, amt, due] + df.to_csv("liabilities.csv", index=False) + + print("Liability added.") + input("Enter...") + + +def main(): + while True: + clear() + header() + + print("1. Sales") + print("2. Stock") + print("3. Products") + print("4. Employees") + print("5. Liabilities") + print("0. Exit") + + choice = input(">> ") + + if choice == "1": + sales_menu() + elif choice == "2": + stock_menu() + elif choice == "3": + product_menu() + elif choice == "4": + employee_menu() + elif choice == "5": + liability_menu() + elif choice == "0": + exit_app() + break + + +if __name__ == "__main__": + setup() + main() \ No newline at end of file From fbdca68bd1e8d393b66e7179bb826ec1ef9ed9f3 Mon Sep 17 00:00:00 2001 From: Sanyam <259812796+Sny4m@users.noreply.github.com> Date: Mon, 20 Jul 2026 12:00:48 +0000 Subject: [PATCH 2/8] added requirements.txt file in /shop-management-sys --- Shop-Management-System/requirements.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 Shop-Management-System/requirements.txt diff --git a/Shop-Management-System/requirements.txt b/Shop-Management-System/requirements.txt new file mode 100644 index 0000000000..1411a4a0b5 --- /dev/null +++ b/Shop-Management-System/requirements.txt @@ -0,0 +1 @@ +pandas \ No newline at end of file From 8915ebed861cfee59b79e5f47c501264c119b975 Mon Sep 17 00:00:00 2001 From: Sanyam <259812796+Sny4m@users.noreply.github.com> Date: Mon, 20 Jul 2026 17:40:05 +0530 Subject: [PATCH 3/8] Update Shop-Management-System/buybye.py Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- Shop-Management-System/buybye.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Shop-Management-System/buybye.py b/Shop-Management-System/buybye.py index 4f2bda59d8..095bde699f 100644 --- a/Shop-Management-System/buybye.py +++ b/Shop-Management-System/buybye.py @@ -128,8 +128,12 @@ def stock_menu(): name = input("Product: ") qty = int(input("Qty: ")) - if name in df["Product"].values: - df.loc[df["Product"] == name, "Qty"] = qty + # use case-insensitive matching to keep behavior consistent with search + name_lower = name.lower() + product_match = df["Product"].str.lower() == name_lower + + if product_match.any(): + df.loc[product_match, "Qty"] = qty else: df.loc[len(df)] = [name, qty] From 4013e6cdd645cad082938484871dd036f21b92e8 Mon Sep 17 00:00:00 2001 From: Sanyam <259812796+Sny4m@users.noreply.github.com> Date: Mon, 20 Jul 2026 12:25:26 +0000 Subject: [PATCH 4/8] reduced duplication and added input validation --- Shop-Management-System/buybye.py | 201 ++++++++++++++++--------------- 1 file changed, 104 insertions(+), 97 deletions(-) diff --git a/Shop-Management-System/buybye.py b/Shop-Management-System/buybye.py index 095bde699f..8c62563aac 100644 --- a/Shop-Management-System/buybye.py +++ b/Shop-Management-System/buybye.py @@ -1,13 +1,19 @@ -import pandas as pd import os import time from datetime import datetime +import pandas as pd + +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) login_time = datetime.now() +def data_path(filename): + return os.path.join(BASE_DIR, filename) + + def clear(): - os.system('cls' if os.name == 'nt' else 'clear') + os.system("cls" if os.name == "nt" else "clear") def header(): @@ -29,12 +35,13 @@ def setup(): "products.csv": ["Product", "Price"], "employees.csv": ["Name", "Role"], "liabilities.csv": ["Name", "Amount", "Due"], - "log.csv": ["Login Time", "Logout Time"] + "log.csv": ["Login Time", "Logout Time"], } - for f, cols in files.items(): - if not os.path.exists(f): - pd.DataFrame(columns=cols).to_csv(f, index=False) + for filename, cols in files.items(): + path = data_path(filename) + if not os.path.exists(path): + pd.DataFrame(columns=cols).to_csv(path, index=False) def show_list(df, kind): @@ -44,23 +51,61 @@ def show_list(df, kind): for i, row in df.iterrows(): if kind == "sales": - print(f"{i+1}. {row['Item']} | Qty: {row['Qty']} | ₹{row['Total']}") + print(f"{i + 1}. {row['Item']} | Qty: {row['Qty']} | ₹{row['Total']}") elif kind == "stock": - print(f"{i+1}. {row['Product']} | Qty: {row['Qty']}") + print(f"{i + 1}. {row['Product']} | Qty: {row['Qty']}") elif kind == "products": - print(f"{i+1}. {row['Product']} | ₹{row['Price']}") + print(f"{i + 1}. {row['Product']} | ₹{row['Price']}") elif kind == "employees": - print(f"{i+1}. {row['Name']} | {row['Role']}") + print(f"{i + 1}. {row['Name']} | {row['Role']}") elif kind == "liab": - print(f"{i+1}. {row['Name']} | ₹{row['Amount']} | Due: {row['Due']}") + print(f"{i + 1}. {row['Name']} | ₹{row['Amount']} | Due: {row['Due']}") + + +def pause(message="\nEnter..."): + input(message) + + +def prompt_text(prompt): + while True: + value = input(prompt).strip() + if value: + return value + print("Please enter a value.") + + +def prompt_int(prompt): + while True: + try: + return int(input(prompt)) + except ValueError: + print("Please enter a valid whole number.") + + +def prompt_float(prompt): + while True: + try: + return float(input(prompt)) + except ValueError: + print("Please enter a valid number.") + + +def show_menu(title, options): + clear() + header() + print(f"{title}\n") + for option in options: + print(option) + return input(">> ") def exit_app(): logout_time = datetime.now() + log_path = data_path("log.csv") - log = pd.read_csv("log.csv") + log = pd.read_csv(log_path) log.loc[len(log)] = [login_time, logout_time] - log.to_csv("log.csv", index=False) + log.to_csv(log_path, index=False) clear() header() @@ -77,176 +122,138 @@ def exit_app(): def sales_menu(): - clear() - header() - df = pd.read_csv("sales.csv") - - print("SALES\n") - print("1. View") - print("2. Add") - - choice = input(">> ") + df = pd.read_csv(data_path("sales.csv")) + choice = show_menu("SALES", ["1. View", "2. Add"]) if choice == "1": clear() header() show_list(df, "sales") - input("\nEnter...") + pause() elif choice == "2": - item = input("Item: ") - qty = int(input("Qty: ")) - price = float(input("Price (₹): ")) + item = prompt_text("Item: ") + qty = prompt_int("Qty: ") + price = prompt_float("Price (₹): ") total = qty * price df.loc[len(df)] = [item, qty, total] - df.to_csv("sales.csv", index=False) + df.to_csv(data_path("sales.csv"), index=False) print(f"Saved: ₹{total}") - input("Enter...") + pause() def stock_menu(): - clear() - header() - df = pd.read_csv("stock.csv") - - print("STOCK\n") - print("1. View") - print("2. Add/Update") - print("3. Search") - - choice = input(">> ") + df = pd.read_csv(data_path("stock.csv")) + choice = show_menu("STOCK", ["1. View", "2. Add/Update", "3. Search"]) if choice == "1": clear() header() show_list(df, "stock") - input("\nEnter...") + pause() elif choice == "2": - name = input("Product: ") - qty = int(input("Qty: ")) + name = prompt_text("Product: ") + qty = prompt_int("Qty: ") # use case-insensitive matching to keep behavior consistent with search name_lower = name.lower() - product_match = df["Product"].str.lower() == name_lower + product_match = df["Product"].astype(str).str.lower() == name_lower if product_match.any(): df.loc[product_match, "Qty"] = qty else: df.loc[len(df)] = [name, qty] - df.to_csv("stock.csv", index=False) + df.to_csv(data_path("stock.csv"), index=False) print("Stock updated.") - input("Enter...") + pause() elif choice == "3": - name = input("Search: ") + name = prompt_text("Search: ") clear() header() result = df[df["Product"].str.contains(name, case=False)] show_list(result, "stock") - input("\nEnter...") + pause() def product_menu(): - clear() - header() - df = pd.read_csv("products.csv") - - print("PRODUCTS\n") - print("1. View") - print("2. Add") - print("3. Change Price") - - choice = input(">> ") + df = pd.read_csv(data_path("products.csv")) + choice = show_menu("PRODUCTS", ["1. View", "2. Add", "3. Change Price"]) if choice == "1": clear() header() show_list(df, "products") - input("\nEnter...") + pause() elif choice == "2": - name = input("Name: ") - price = float(input("Price (₹): ")) + name = prompt_text("Name: ") + price = prompt_float("Price (₹): ") df.loc[len(df)] = [name, price] - df.to_csv("products.csv", index=False) + df.to_csv(data_path("products.csv"), index=False) print("Product added.") - input("Enter...") + pause() elif choice == "3": - name = input("Product: ") - price = float(input("New price (₹): ")) + name = prompt_text("Product: ") + price = prompt_float("New price (₹): ") df.loc[df["Product"] == name, "Price"] = price - df.to_csv("products.csv", index=False) + df.to_csv(data_path("products.csv"), index=False) print("Price updated.") - input("Enter...") + pause() def employee_menu(): - clear() - header() - df = pd.read_csv("employees.csv") - - print("EMPLOYEES\n") - print("1. View") - print("2. Add") - print("3. Filter") - - choice = input(">> ") + df = pd.read_csv(data_path("employees.csv")) + choice = show_menu("EMPLOYEES", ["1. View", "2. Add", "3. Filter"]) if choice == "1": clear() header() show_list(df, "employees") - input("\nEnter...") + pause() elif choice == "2": - name = input("Name: ") - role = input("Role: ") + name = prompt_text("Name: ") + role = prompt_text("Role: ") df.loc[len(df)] = [name, role] - df.to_csv("employees.csv", index=False) + df.to_csv(data_path("employees.csv"), index=False) print("Employee added.") - input("Enter...") + pause() elif choice == "3": - role = input("Role: ") + role = prompt_text("Role: ") clear() header() result = df[df["Role"].str.contains(role, case=False)] show_list(result, "employees") - input("\nEnter...") + pause() def liability_menu(): - clear() - header() - df = pd.read_csv("liabilities.csv") - - print("LIABILITIES\n") - print("1. View") - print("2. Add") - - choice = input(">> ") + df = pd.read_csv(data_path("liabilities.csv")) + choice = show_menu("LIABILITIES", ["1. View", "2. Add"]) if choice == "1": clear() header() show_list(df, "liab") - input("\nEnter...") + pause() elif choice == "2": - name = input("Name: ") - amt = float(input("Amount (₹): ")) - due = input("Due date: ") + name = prompt_text("Name: ") + amt = prompt_float("Amount (₹): ") + due = prompt_text("Due date: ") df.loc[len(df)] = [name, amt, due] - df.to_csv("liabilities.csv", index=False) + df.to_csv(data_path("liabilities.csv"), index=False) print("Liability added.") - input("Enter...") + pause() def main(): From 261baada8ab7d3d81733a0a6fc93debd63bf26f8 Mon Sep 17 00:00:00 2001 From: Sanyam <259812796+Sny4m@users.noreply.github.com> Date: Mon, 20 Jul 2026 12:37:59 +0000 Subject: [PATCH 5/8] added docstrings in code --- Shop-Management-System/buybye.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Shop-Management-System/buybye.py b/Shop-Management-System/buybye.py index 8c62563aac..7e9f2f71f4 100644 --- a/Shop-Management-System/buybye.py +++ b/Shop-Management-System/buybye.py @@ -9,19 +9,22 @@ def data_path(filename): + """Return the full path to a data file inside the script directory.""" return os.path.join(BASE_DIR, filename) def clear(): + """Clear the terminal screen.""" os.system("cls" if os.name == "nt" else "clear") def header(): + """Print the app banner and title.""" print(r""" ██████╗ ██╗ ██╗██╗ ██╗██████╗ ██╗ ██╗███████╗ ██╔══██╗██║ ██║╚██╗ ██╔╝██╔══██╗╚██╗ ██╔╝██╔════╝ -██████╔╝██║ ██║ ╚████╔╝ ██████╔╝ ╚████╔╝ █████╗ -██╔══██╗██║ ██║ ╚██╔╝ ██╔══██╗ ╚██╔╝ ██╔══╝ +██████╔╝██║ ██║ ╚████╔╝ ██████╔╝ ╚████╔╝ █████╗ +██╔══██╗██║ ██║ ╚██╔╝ ██╔══██╗ ╚██╔╝ ██╔══╝ ██████╔╝╚██████╔╝ ██║ ██████╔╝ ██║ ███████╗ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚══════╝ """) @@ -29,6 +32,7 @@ def header(): def setup(): + """Create the CSV data files if they do not already exist.""" files = { "sales.csv": ["Item", "Qty", "Total"], "stock.csv": ["Product", "Qty"], @@ -45,6 +49,7 @@ def setup(): def show_list(df, kind): + """Display rows from a dataframe based on the selected section.""" if df.empty: print("No data found.\n") return From 5f69e1ef81294dac00be0343bca45367ca1ee38a Mon Sep 17 00:00:00 2001 From: Sanyam <259812796+Sny4m@users.noreply.github.com> Date: Mon, 20 Jul 2026 12:48:48 +0000 Subject: [PATCH 6/8] documentation update --- Shop-Management-System/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Shop-Management-System/README.md b/Shop-Management-System/README.md index 04573cc591..00abfbaadc 100644 --- a/Shop-Management-System/README.md +++ b/Shop-Management-System/README.md @@ -8,11 +8,11 @@ A minimal CLI shop manager to track stock, sales, and more — no bloat, just wo 1. Clone the repository: ``` - git clone https://github.com/s4nyam07/BuyBye.git + git clone https://github.com/avinashkranjan/Amazing-Python-Scripts.git ``` 3. Install dependency: ``` - pip install pandas + pip install requirements.txt ``` 4. Run the app, all required files are created automatically on first launch. From 7eb6b7be09ca1d5ba96f01f4bbe0e2b26861d938 Mon Sep 17 00:00:00 2001 From: Sanyam <259812796+Sny4m@users.noreply.github.com> Date: Mon, 20 Jul 2026 12:54:09 +0000 Subject: [PATCH 7/8] added docstrings improved documentation --- Shop-Management-System/buybye.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Shop-Management-System/buybye.py b/Shop-Management-System/buybye.py index 7e9f2f71f4..81a6df1a9b 100644 --- a/Shop-Management-System/buybye.py +++ b/Shop-Management-System/buybye.py @@ -68,10 +68,12 @@ def show_list(df, kind): def pause(message="\nEnter..."): + """Pause execution until the user presses Enter.""" input(message) def prompt_text(prompt): + """Prompt the user for a non-empty text value.""" while True: value = input(prompt).strip() if value: @@ -80,6 +82,7 @@ def prompt_text(prompt): def prompt_int(prompt): + """Prompt the user for a whole number value.""" while True: try: return int(input(prompt)) @@ -88,6 +91,7 @@ def prompt_int(prompt): def prompt_float(prompt): + """Prompt the user for a numeric value.""" while True: try: return float(input(prompt)) @@ -96,6 +100,7 @@ def prompt_float(prompt): def show_menu(title, options): + """Display a menu and return the user's selection.""" clear() header() print(f"{title}\n") @@ -105,6 +110,7 @@ def show_menu(title, options): def exit_app(): + """Log the session end time and show the logout animation.""" logout_time = datetime.now() log_path = data_path("log.csv") @@ -127,6 +133,7 @@ def exit_app(): def sales_menu(): + """Manage sales entries through the sales menu.""" df = pd.read_csv(data_path("sales.csv")) choice = show_menu("SALES", ["1. View", "2. Add"]) @@ -150,6 +157,7 @@ def sales_menu(): def stock_menu(): + """Manage stock entries through the stock menu.""" df = pd.read_csv(data_path("stock.csv")) choice = show_menu("STOCK", ["1. View", "2. Add/Update", "3. Search"]) @@ -186,6 +194,7 @@ def stock_menu(): def product_menu(): + """Manage product records through the products menu.""" df = pd.read_csv(data_path("products.csv")) choice = show_menu("PRODUCTS", ["1. View", "2. Add", "3. Change Price"]) @@ -213,6 +222,7 @@ def product_menu(): def employee_menu(): + """Manage employee records through the employees menu.""" df = pd.read_csv(data_path("employees.csv")) choice = show_menu("EMPLOYEES", ["1. View", "2. Add", "3. Filter"]) @@ -240,6 +250,7 @@ def employee_menu(): def liability_menu(): + """Manage liabilities through the liabilities menu.""" df = pd.read_csv(data_path("liabilities.csv")) choice = show_menu("LIABILITIES", ["1. View", "2. Add"]) @@ -262,6 +273,7 @@ def liability_menu(): def main(): + """Run the main interactive shop management loop.""" while True: clear() header() @@ -292,4 +304,5 @@ def main(): if __name__ == "__main__": setup() - main() \ No newline at end of file + main() + \ No newline at end of file From 2f25bc040a8527f948b8afb204762a6efb94f95e Mon Sep 17 00:00:00 2001 From: Sanyam <259812796+Sny4m@users.noreply.github.com> Date: Mon, 20 Jul 2026 12:58:04 +0000 Subject: [PATCH 8/8] fixed issues detected by deepspace --- Shop-Management-System/buybye.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Shop-Management-System/buybye.py b/Shop-Management-System/buybye.py index 81a6df1a9b..9f1b0aa5fd 100644 --- a/Shop-Management-System/buybye.py +++ b/Shop-Management-System/buybye.py @@ -305,4 +305,3 @@ def main(): if __name__ == "__main__": setup() main() - \ No newline at end of file