Reputation: 1483
Is there any Python module out there that can be used to create an Excel XLSX file replicating the format from a template?
Upvotes: 2
Views: 4775
Reputation: 834
As far as I understood openpyxl
supports this. This is example from docs:
from openpyxl import load_workbook
wb = load_workbook('sample_book.xltx')
ws = wb.active
ws['D2'] = 42
wb.save('sample_book.xlsx')
Upvotes: 2
Reputation: 675
You can use openpyxl to open a template file and then populate it with data and save it as something else to preserve the original template for use later. Check out this answer: Working with Excel In Python
Upvotes: 0