I want to develop a Python package for maintaining Excel based report templates. An example would be a template for a list of personal contact information. The template would have a page header and a table header, both with specific formatting. Some columns could contain formulas. The Workbook may contain VBA modules.
To manage the versions of the template over time I would like to use Git. Hence the source of the template should be text based. I am currently considering two strategies and would like to know if there are any existing packages or tools that can be leveraged. Both strategies make use of text based sources and can generate formatted output including VBA modules if needed.
Strategy 1 – Class based page model generates Workbook when instantiated
I got this idea from creating page object models with Selenium for testing web pages. A similar model could be made to generate a Workbook upon instantiation, instead of discovering controls. Perhaps it could actually be used for both purposes – generating and testing workbooks?
Strategy 2 – Workbook “factory” generates Workbook based on information structure
This could be something similar to DITA-OT that I have worked with in the past. A set of XML or JSON files define the template and is given as input to a function that generates and returns a Workbook. This function does not have to be Python, but could be basically any executable.
Is there anything like this out there or do I need to start from scratch?