A Javascript library for parsing .xlsx files. It includes sample code along with demo for integration with AngularJS. Use cases include listing sheet names for selection in a form, showing preview of selected sheet etc.

Recently, I had to create a new web app, which would generate PDF reports based on data stored in excel worksheets. As usual, I used Django along with many other Python libraries for this.

It has following parts:

HTML Form - To select excel files and upload it to server

Parsing uploaded excel file - Basic validation followed by reading data from worksheets. I used xlrd module from Python-Excel project for this.

So, everything was working like a charm, except the fact that web app was reading data from first worksheet by index whenever an excel workbook was uploaded. But, user should be able to tell which worksheet to read from, right?

For this, I needed to know sheet names for selected excel workbook and then show a select box to choose one sheet name. I also wanted to show data stored in that worksheet in a table, a preview.

After couple of Google searches for "reading excel files using javascript", I landed up on homepage of SheetJS project. They have two projects, js-xlsx and js-xls, but I did not get "for human beings" feeling from this (if you have see requests vs urllib2 then you know what I mean).

P.S. - I have tested everything on Google Chrome and Mozilla Firefox only. Since, this web appliaction is for internal use, I don't have to deal with browser compatibility issues. But, it should work in all browsers supported by Lodash and SheetJS.