This script parses an .xlsx file and converts it into a text format which can be compared using git.
I wrote this script as I wanted to use a version control package for managing an existing computational model, the input files of which are defined using Microsoft Excel workbooks.
See my blog entry for more details of how it works.
- Download the latest release
- Run
python setup.py install
- Add the following lines to the global .gitconfig file:
[diff "git_diff_xlsx"]
binary = True
textconv = parse_xlsx
cachetextconv = true
- Add the following line to your repository's
.gitattributes
file*.xlsx diff=git_diff_xlsx
- Now, typing
git diff
at the prompt will produce differences between text versions of Excel.xlsx
files
There are a bunch of issues with this script. I wrote it to fulfil a need I had then and there and there are lots of hard-coded horrors. Please feel free to contribute to cleaning up the code, submit issues and pull-requests.