Giter VIP home page Giter VIP logo

git_diff_xlsx's Introduction

git_diff_xlsx Build Status

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.

Installation

  1. Download the latest release
  2. Run python setup.py install
  3. Add the following lines to the global .gitconfig file:
    [diff "git_diff_xlsx"]
    binary = True
    textconv = parse_xlsx
    cachetextconv = true
  1. Add the following line to your repository's .gitattributes file *.xlsx diff=git_diff_xlsx
  2. Now, typing git diff at the prompt will produce differences between text versions of Excel .xlsx files

Caveats

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.

git_diff_xlsx's People

Contributors

paux avatar willu47 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

git_diff_xlsx's Issues

Enhanced display of non-ascii friendly content

Thanks for this useful script, I made the following change to add some robustness in handling non-ascii friendly content that may appear in the Excel files, such as curly quotes.

line 61:
output += unicodedata.normalize('NFKD', unicode(content)).encode('utf-8', 'ignore')

Sample output as follows:

 =================================
-Sheet: Sheet1[ 4 , 2 ]
+Sheet: Sheet1[ 5 , 5 ]
 =================================
     B3:
         Col1
     A4:
         Row1
     B4:
-        456.0
+        "456"
+    A5:
+        Row2
+    B5:
+        “test”
+    C5:
+        °C
+    D5:
+        ⛨
+    E5:
+        Ɛ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.