Download utils/file_initializer.py from nagasurendra/restaurant-ordering-system: direct link, hf CLI and curl.
- Browser
- Download file 670 Bytes
-
https://huggingface.co/spaces/nagasurendra/restaurant-ordering-system/resolve/main/utils/file_initializer.py
- Command line
-
hf download hf://spaces/nagasurendra/restaurant-ordering-system/utils/file_initializer.py
-
curl -L -o file_initializer.py https://huggingface.co/spaces/nagasurendra/restaurant-ordering-system/resolve/main/utils/file_initializer.py
670 Bytes
| import os | |
| import pandas as pd | |
| CUSTOMERS_FILE = "database/customers.xlsx" | |
| MENU_FILE = "database/menu.xlsx" | |
| ORDERS_FILE = "database/orders.xlsx" | |
| def initialize_files(): | |
| if not os.path.exists("database"): | |
| os.makedirs("database") | |
| if not os.path.exists(CUSTOMERS_FILE): | |
| pd.DataFrame(columns=["Name", "Email", "Password"]).to_excel(CUSTOMERS_FILE, index=False) | |
| if not os.path.exists(MENU_FILE): | |
| pd.DataFrame(columns=["Item", "Category", "Price"]).to_excel(MENU_FILE, index=False) | |
| if not os.path.exists(ORDERS_FILE): | |
| pd.DataFrame(columns=["Table", "Customer", "OrderDetails", "TotalAmount"]).to_excel(ORDERS_FILE, index=False) | |