{"id":26380534,"url":"https://github.com/itayshaul111/bgu-mart","last_synced_at":"2025-06-11T14:33:42.111Z","repository":{"id":279245145,"uuid":"938184923","full_name":"ItayShaul111/BGU-Mart","owner":"ItayShaul111","description":"Assignment 4 - SPL course, BGU","archived":false,"fork":false,"pushed_at":"2025-02-24T14:57:36.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T15:46:45.866Z","etag":null,"topics":["python","sql","sqlite3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ItayShaul111.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-24T14:57:02.000Z","updated_at":"2025-02-24T15:03:44.000Z","dependencies_parsed_at":"2025-02-24T15:46:51.185Z","dependency_job_id":"98c01776-2584-49f7-bb7e-c2e8a1f56d07","html_url":"https://github.com/ItayShaul111/BGU-Mart","commit_stats":null,"previous_names":["itayshaul111/bgu-mart"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItayShaul111%2FBGU-Mart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItayShaul111%2FBGU-Mart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItayShaul111%2FBGU-Mart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItayShaul111%2FBGU-Mart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ItayShaul111","download_url":"https://codeload.github.com/ItayShaul111/BGU-Mart/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243981146,"owners_count":20378530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","sql","sqlite3"],"created_at":"2025-03-17T05:32:11.342Z","updated_at":"2025-06-11T14:33:42.100Z","avatar_url":"https://github.com/ItayShaul111.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛒 BGU Mart\n**Supermarket Management System – SPL 2025 @ BGU**\n\nA Python-based inventory and activity management system for supermarket chains, developed as part of the **Systems Programming Lab (SPL)** course at Ben-Gurion University.  \nThe system uses an SQLite3 database to track branches, employees, products, suppliers, and sales/delivery activities.\n\n---\n\n## 🔧 Technologies Used\n- **Python 3.9+** – Core implementation\n- **SQLite3** – Embedded database engine\n- **Command-line Interface** – Standalone scripts for initialization, actions, and reporting\n\n---\n\n## 💡 Project Structure\n```\nBGU-Mart/\n├── bgumart.db            # SQLite database (created at runtime)\n├── initiate.py           # Initializes the database from a configuration file\n├── action.py             # Executes activity actions (sales/deliveries)\n├── printdb.py            # Prints database tables and reports\n├── config.txt            # Sample configuration file\n├── actions.txt           # Sample activity input file\n└── README.md             # Project documentation\n```\n\n---\n\n## 🏬 Database Schema\n\n| Table        | Description |\n|--------------|-------------|\n| `employees`  | ID, name, salary, and branch assignment |\n| `suppliers`  | Supplier ID, name, contact information |\n| `products`   | Product ID, description, price, quantity in stock |\n| `branches`   | Branch ID, location, and employee count |\n| `activities` | Logs of sales and deliveries (product ID, quantity, actor ID, date) |\n\n---\n\n## 📦 Configuration File Format (`config.txt`)\n\nEach line defines one entity using the following format:\n\n| Prefix | Entity     | Format |\n|--------|------------|--------|\n| `B`    | Branch     | `B,\u003cid\u003e,\u003clocation\u003e,\u003cnum_employees\u003e` |\n| `E`    | Employee   | `E,\u003cid\u003e,\u003cname\u003e,\u003csalary\u003e,\u003cbranch_id\u003e` |\n| `P`    | Product    | `P,\u003cid\u003e,\u003cdescription\u003e,\u003cprice\u003e,\u003cquantity\u003e` |\n| `S`    | Supplier   | `S,\u003cid\u003e,\u003cname\u003e,\u003ccontact_info\u003e` |\n\nExample:\n```\nB,3,Chicago,40\nE,106,Sue Davis,75000,3\nP,5,Mango,2,7\nS,6,Jkl Enterprises,(678) 901-2345\n```\n\n\u003e ⚠ Do **not** insert the record-type prefixes (E, S, P, B) into the database.\n\n---\n\n## 📈 Actions File Format (`actions.txt`)\n\nFormat:\n```\n\u003cproduct_id\u003e,\u003cquantity\u003e,\u003cactivator_id\u003e,\u003cdate\u003e\n```\n\n- `quantity \u003e 0` → delivery (by supplier)  \n- `quantity \u003c 0` → sale (by employee)\n\nExample:\n```\n3,500,56,20230110      # Delivery from supplier 56\n100,-500,1234,20230110 # Sale by employee 1234\n```\n\n\u003e ⚠ Sale is performed only if product stock is sufficient — otherwise, it's ignored silently.\n\n---\n\n## 🚀 How to Run\n\n### 1. Initialize the Database\n```bash\npython3 initiate.py config.txt\n```\n\n### 2. Perform Actions\n```bash\npython3 action.py actions.txt\n```\n\n### 3. Print Reports\n```bash\npython3 printdb.py\n```\n\n---\n\n## 📊 Report Output Formats\n\n### 👩‍💼 Employees Report\n```\n\u003cname\u003e \u003csalary\u003e \u003cbranch_location\u003e \u003ctotal_sales_income\u003e\n```\n\nSorted by name.\n\n### 📆 Activity Report\n```\n\u003cdate\u003e \u003cproduct_description\u003e \u003cquantity\u003e \u003cseller_name\u003e \u003csupplier_name\u003e\n```\n\n- For delivery: `seller_name = None`  \n- For sale: `supplier_name = None`\n\nSorted by date.\n\n---\n\n## 🧪 Testing\nValidate memory and SQL correctness with:\n```bash\nvalgrind --leak-check=full --show-reachable=yes python3 action.py actions.txt\n```\n\n---\n\n## 📚 Course Information\n- **Course:** SPL – Systems Programming Lab  \n- **Institution:** Ben-Gurion University of the Negev  \n- **Year:** 2025  \n- **Environment:** Linux CS Lab, SQLite3, Python 3.9+\n\n---\n\n## 🧑‍💻 Authors\n\n**Ben Kapon**  \nStudent at BGU  \n[LinkedIn](https://www.linkedin.com/in/ben-kapon1/)\n\n**Itay Shaul**  \nStudent at BGU  \n[LinkedIn](https://www.linkedin.com/in/itay-shaul/)\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitayshaul111%2Fbgu-mart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitayshaul111%2Fbgu-mart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitayshaul111%2Fbgu-mart/lists"}