Coders Packet

Bill Generator in MS-EXCEL using Openpyxl library of Python

By Deepanshu Mittal

This project helps user to generate a Customer Bill in MS-EXCEL from a list of items taken by the user as input, using 'openpyxl' library of Python.

This project generates a Bill in MS-EXCEL 'bill.xlsx' from a list of items in a text file 'list.txt' using 'openpyxl' library of Python. In this project, another library used is 'datetime'.


'Openpyxl' library needs to be installed on the system to run the program 'code.py'. To install 'openpyxl' library run the following command in the terminal: "pip install openpyxl".


Functionality 'Alignment' is imported from 'openpyxl.styles' for aligning the data in the Bill generated in MS-EXCEL. 'Datetime' library is used to get the date and time at the time of generation of Bill and this time is printed in the Bill.


The user needs to give a list of items in 'list.txt' in the format: "Quantity | Item Name | Price per 1 unit" for every item in the list in separate lines.


Then run the 'code.py' Python program.
It will create a 'bill.xlsx' MS-EXCEL database in the same folder. This MS-EXCEL file contains the generated bill.

For example, this is the 'list.txt':

On running the 'code.py' python program, this is the generated bill:

Download Complete Code

Comments

No comments yet