├── README.md ├── LICENSE ├── forecasting.py ├── finalmailsendingxllimit.py ├── final.py ├── finalhard.py ├── finaladdmail.py └── .gitignore /README.md: -------------------------------------------------------------------------------- 1 | # automatic-billing -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /forecasting.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import numpy as np 3 | import matplotlib.pyplot as plt 4 | from statsmodels.tsa.arima.model import ARIMA 5 | 6 | # Load the time series data of product demand 7 | data = pd.read_csv('product_demand_data.csv', index_col='date', parse_dates=True) 8 | 9 | # Data preprocessing (if needed) 10 | # e.g., handle missing values, convert data types, resample, etc. 11 | 12 | # Split the data into training and testing sets 13 | train_data = data.iloc[:80] 14 | test_data = data.iloc[80:] 15 | 16 | # ARIMA model configuration 17 | order = (1, 0, 0) # ARIMA(p, d, q) parameters 18 | 19 | # Create and train ARIMA model 20 | model = ARIMA(train_data, order=order) 21 | model_fit = model.fit() 22 | 23 | # Make forecasts 24 | forecast_values = model_fit.forecast(steps=len(test_data)) 25 | 26 | # Model evaluation 27 | mse = np.mean((forecast_values - test_data.values)**2) 28 | rmse = np.sqrt(mse) 29 | mae = np.mean(np.abs(forecast_values - test_data.values)) 30 | 31 | # Visualize the forecasts 32 | plt.plot(train_data, label='Train Data') 33 | plt.plot(test_data, label='Test Data') 34 | plt.plot(test_data.index, forecast_values, label='Forecasted Values') 35 | plt.xlabel('Date') 36 | plt.ylabel('Product Demand') 37 | plt.title('ARIMA Forecast for Product Demand') 38 | plt.legend() 39 | plt.show() 40 | -------------------------------------------------------------------------------- /finalmailsendingxllimit.py: -------------------------------------------------------------------------------- 1 | from statistics import mode 2 | from openpyxl import Workbook 3 | from openpyxl import load_workbook 4 | wb = Workbook() 5 | 6 | 7 | wb = load_workbook("D:\\xlfile\listitems.xlsx") 8 | tot_price = 0 9 | a = wb.active 10 | total=int(input("Enter the no of products")) 11 | for j in range(1,total+1): 12 | name=input("Enter the product") 13 | quantities=int(input("Enter the quantities")) 14 | for i in range(1,100000): 15 | product = a.cell(row=i,column=2) 16 | if product.value == name: 17 | quantity = a.cell(row=i,column=3).value 18 | print(type(a.cell(row=i,column=3).value)) 19 | a.cell(row=i,column=3,value=(quantity-quantities)) 20 | print("modified") 21 | tot_price += (a.cell(row=i,column=4).value)*quantities 22 | break 23 | print('total price = ',tot_price) 24 | for i in range(2,16): 25 | if int (a.cell(row=i,column=3).value)<=10: 26 | 27 | print("This product is below the limit:",a.cell(row=i,column=2).value) 28 | aircel = a.cell(row=i,column=2).value 29 | wb.save("D:\\xlfile\listitems.xlsx") 30 | from email.message import EmailMessage 31 | import ssl 32 | import smtplib 33 | 34 | email_sender = "jrn03540@gmail.com" 35 | email_password = "jimzlkimpykmlaqh" 36 | email_receiver = "lioneljames987@gmail.com" 37 | subject = "surya" 38 | body =aircel 39 | en = EmailMessage() 40 | en['From'] = email_sender 41 | en['To'] = email_receiver 42 | en['subject'] = subject 43 | en.set_content(body) 44 | 45 | context = ssl.create_default_context() 46 | 47 | with smtplib.SMTP_SSL('smtp.gmail.com', 465, context=context) as smtp: 48 | smtp.login(email_sender,email_password) 49 | smtp.sendmail(email_sender,email_receiver,en.as_string()) 50 | else: 51 | pass 52 | wb.save("D:\\xlfile\listitems.xlsx") -------------------------------------------------------------------------------- /final.py: -------------------------------------------------------------------------------- 1 | from statistics import mode 2 | from openpyxl import Workbook 3 | from openpyxl import load_workbook 4 | wb = Workbook() 5 | 6 | 7 | wb = load_workbook("D:\\xlfile\listitems.xlsx") 8 | tot_price = 0 9 | a = wb.active 10 | j=1 11 | print("WELCOME") 12 | while j<1000: 13 | 14 | name=input("ENTER THE PRODUCT : ") 15 | if name=="N": 16 | break 17 | else: 18 | quantities=int(input("ENTER THE QUANTITIES : ")) 19 | for i in range(1,100000): 20 | product = a.cell(row=i,column=2) 21 | if product.value == name: 22 | quantity = a.cell(row=i,column=3).value 23 | 24 | a.cell(row=i,column=3,value=(quantity-quantities)) 25 | print("ADD ITEMS TO YOUR CART \n OTHERWISE") 26 | print("PRESS N TO EXIT") 27 | tot_price += (a.cell(row=i,column=4).value)*quantities 28 | break 29 | print('TOTAL PRICE = ',tot_price) 30 | for i in range(2,16): 31 | if int (a.cell(row=i,column=3).value)<=10: 32 | 33 | print("This product is below the limit:",a.cell(row=i,column=2).value) 34 | aircel = a.cell(row=i,column=2).value 35 | wb.save("D:\\xlfile\listitems.xlsx") 36 | from email.message import EmailMessage 37 | import ssl 38 | import smtplib 39 | 40 | email_sender = "jrn03540@gmail.com" 41 | email_password = "jimzlkimpykmlaqh" 42 | email_receiver = "lioneljames987@gmail.com" 43 | subject = "surya" 44 | body =aircel 45 | en = EmailMessage() 46 | en['From'] = email_sender 47 | en['To'] = email_receiver 48 | en['subject'] = subject 49 | en.set_content(body) 50 | 51 | context = ssl.create_default_context() 52 | 53 | with smtplib.SMTP_SSL('smtp.gmail.com', 465, context=context) as smtp: 54 | smtp.login(email_sender,email_password) 55 | smtp.sendmail(email_sender,email_receiver,en.as_string()) 56 | else: 57 | pass 58 | wb.save("D:\\xlfile\listitems.xlsx") -------------------------------------------------------------------------------- /finalhard.py: -------------------------------------------------------------------------------- 1 | from statistics import mode 2 | from openpyxl import Workbook 3 | from openpyxl import load_workbook 4 | wb = Workbook() 5 | ab = Workbook() 6 | cb = Workbook() 7 | 8 | 9 | wb = load_workbook("D:\\xlfile\listitems.xlsx") 10 | tot_price = 0 11 | a = wb.active 12 | 13 | j=1 14 | print("WELCOME") 15 | while j<1000: 16 | 17 | name=input("ENTER THE PRODUCT : ") 18 | if name=="N": 19 | break 20 | else: 21 | quantities=int(input("ENTER THE QUANTITIES : ")) 22 | for i in range(1,100000): 23 | product = a.cell(row=i,column=2) 24 | if product.value == name: 25 | quantity = a.cell(row=i,column=3).value 26 | 27 | a.cell(row=i,column=3,value=(quantity-quantities)) 28 | 29 | print("ADD ITEMS TO YOUR CART \n OTHERWISE") 30 | print("PRESS N TO EXIT") 31 | tot_price += (a.cell(row=i,column=4).value)*quantities 32 | wb.save("D:\\xlfile\listitems.xlsx") 33 | ab=load_workbook("soldout.xlsx") 34 | b = ab.active 35 | for k in range(1,100000): 36 | product = b.cell(row=k,column=2) 37 | if product.value == name: 38 | quantity = b.cell(row=k,column=3).value 39 | b.cell(row=i,column=3,value=(quantity+quantities)) 40 | ab.save("soldout.xlsx") 41 | break 42 | else: 43 | pass 44 | break 45 | print('TOTAL PRICE = ',tot_price) 46 | for i in range(2,141): 47 | if int ((a.cell(row=i,column=3).value)<=10): 48 | 49 | 50 | aircel = a.cell(row=i,column=2).value 51 | email=a.cell(row=i,column=5).value 52 | 53 | from email.message import EmailMessage 54 | import ssl 55 | import smtplib 56 | 57 | email_sender = "jrn03540@gmail.com" 58 | email_password = "jimzlkimpykmlaqh" 59 | email_receiver = email 60 | subject = "This product is below the limit.So, please send the stock ASAP!" 61 | body =aircel 62 | en = EmailMessage() 63 | en['From'] = email_sender 64 | en['To'] = email_receiver 65 | en['subject'] = subject 66 | en.set_content(body) 67 | 68 | context = ssl.create_default_context() 69 | 70 | with smtplib.SMTP_SSL('smtp.gmail.com', 465, context=context) as smtp: 71 | smtp.login(email_sender,email_password) 72 | smtp.sendmail(email_sender,email_receiver,en.as_string()) 73 | 74 | 75 | 76 | else: 77 | pass 78 | 79 | cb=load_workbook("soldout.xlsx") 80 | c=cb.active 81 | max=c.cell(row=2,column=3).value 82 | demand=c.cell(row=2,column=2).value 83 | 84 | for l in range(2,141): 85 | if int ((c.cell(row=l,column=3).value)>max): 86 | demand=c.cell(row=l,column=2).value 87 | print("THIS PRODUCT DEMAND IS HIGH:",demand) 88 | cb.save("soldout.xlsx") -------------------------------------------------------------------------------- /finaladdmail.py: -------------------------------------------------------------------------------- 1 | from statistics import mode 2 | from openpyxl import Workbook 3 | from openpyxl import load_workbook 4 | wb = Workbook() 5 | 6 | 7 | wb = load_workbook("D:\\xlfile\listitems.xlsx") 8 | tot_price = 0 9 | a = wb.active 10 | j=1 11 | print("WELCOME") 12 | while j<1000: 13 | 14 | name=input("ENTER THE PRODUCT : ") 15 | if name=="N": 16 | break 17 | else: 18 | quantities=int(input("ENTER THE QUANTITIES : ")) 19 | for i in range(1,100000): 20 | product = a.cell(row=i,column=2) 21 | if product.value == name: 22 | quantity = a.cell(row=i,column=3).value 23 | 24 | a.cell(row=i,column=3,value=(quantity-quantities)) 25 | print("ADD ITEMS TO YOUR CART \n OTHERWISE") 26 | print("PRESS N TO EXIT") 27 | tot_price += (a.cell(row=i,column=4).value)*quantities 28 | break 29 | print('TOTAL PRICE = ',tot_price) 30 | for i in range(2,16): 31 | if int (a.cell(row=i,column=3).value)<=10: 32 | 33 | print("This product is below the limit:",a.cell(row=i,column=2).value) 34 | aircel = a.cell(row=i,column=2).value 35 | wb.save("D:\\xlfile\listitems.xlsx") 36 | from email.message import EmailMessage 37 | import ssl 38 | import smtplib 39 | 40 | email_sender = "jrn03540@gmail.com" 41 | email_password = "jimzlkimpykmlaqh" 42 | if (aircel=="Salt"): 43 | email_receiver = "lioneljames987@gmail.com" 44 | subject = "surya" 45 | body =aircel 46 | en = EmailMessage() 47 | en['From'] = email_sender 48 | en['To'] = email_receiver 49 | en['subject'] = subject 50 | en.set_content(body) 51 | 52 | context = ssl.create_default_context() 53 | 54 | with smtplib.SMTP_SSL('smtp.gmail.com', 465, context=context) as smtp: 55 | smtp.login(email_sender,email_password) 56 | smtp.sendmail(email_sender,email_receiver,en.as_string()) 57 | elif(aircel=="Garlic"): 58 | email_receiver = "suryasurya12837@gmail.com" 59 | subject = "surya" 60 | body =aircel 61 | en = EmailMessage() 62 | en['From'] = email_sender 63 | en['To'] = email_receiver 64 | en['subject'] = subject 65 | en.set_content(body) 66 | 67 | context = ssl.create_default_context() 68 | 69 | with smtplib.SMTP_SSL('smtp.gmail.com', 465, context=context) as smtp: 70 | smtp.login(email_sender,email_password) 71 | smtp.sendmail(email_sender,email_receiver,en.as_string()) 72 | elif(aircel=="Pepper"): 73 | email_receiver = "thulasidharanb26@gmail.com" 74 | subject = "surya" 75 | body =aircel 76 | en = EmailMessage() 77 | en['From'] = email_sender 78 | en['To'] = email_receiver 79 | en['subject'] = subject 80 | en.set_content(body) 81 | 82 | context = ssl.create_default_context() 83 | 84 | with smtplib.SMTP_SSL('smtp.gmail.com', 465, context=context) as smtp: 85 | smtp.login(email_sender,email_password) 86 | smtp.sendmail(email_sender,email_receiver,en.as_string()) 87 | else: 88 | pass 89 | else: 90 | pass 91 | wb.save("D:\\xlfile\listitems.xlsx") -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # poetry 98 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 99 | # This is especially recommended for binary packages to ensure reproducibility, and is more 100 | # commonly ignored for libraries. 101 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 102 | #poetry.lock 103 | 104 | # pdm 105 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 106 | #pdm.lock 107 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 108 | # in version control. 109 | # https://pdm.fming.dev/#use-with-ide 110 | .pdm.toml 111 | 112 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 113 | __pypackages__/ 114 | 115 | # Celery stuff 116 | celerybeat-schedule 117 | celerybeat.pid 118 | 119 | # SageMath parsed files 120 | *.sage.py 121 | 122 | # Environments 123 | .env 124 | .venv 125 | env/ 126 | venv/ 127 | ENV/ 128 | env.bak/ 129 | venv.bak/ 130 | 131 | # Spyder project settings 132 | .spyderproject 133 | .spyproject 134 | 135 | # Rope project settings 136 | .ropeproject 137 | 138 | # mkdocs documentation 139 | /site 140 | 141 | # mypy 142 | .mypy_cache/ 143 | .dmypy.json 144 | dmypy.json 145 | 146 | # Pyre type checker 147 | .pyre/ 148 | 149 | # pytype static type analyzer 150 | .pytype/ 151 | 152 | # Cython debug symbols 153 | cython_debug/ 154 | 155 | # PyCharm 156 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 157 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 158 | # and can be added to the global gitignore or merged into this file. For a more nuclear 159 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 160 | #.idea/ 161 | --------------------------------------------------------------------------------