5 ms·
NPR open-sources Copytext, a library for handling spreadsheets as Python objects
- commandar 12y agoBlog post explaining what problem this is meant to solve in more detail: http://blog.apps.npr.org/2014/04/21/introducing-copytext-py.html http://blog.apps.npr.org/2014/04/21/introducing-copytext-py....
- 001sky 12y ago"The spreadsheet is your CMS"
- pie 12y agoAnother useful tool for working with spreadsheets in Javascript is SheetJS: https://github.com/SheetJS/js-xlsx https://github.com/SheetJS/js-xlsx
- stefantalpalaru 12y agoIt would be nice to mention that this is a wrapper around openpyxl: http://pythonhosted.org/openpyxl/ http://pythonhosted.org/openpyxl/
- cschmidt 12y agoI realize that this project is about reading excel files. However, if you're creating spreadsheets from python it is worth mentioning that there are 3 different packages. In my experience: xlwt [1] < openpyxl [2] < XlsxWriter [3] [1] http://www.python-excel.org/ http://www.python-excel.org/ [2] http://pythonhosted.org/openpyxl/ http://pythonhosted.org/openpyxl/ [3] https://xlsxwriter.readthedocs.org/ https://xlsxwriter.readthedocs.org/ The docs of XlsxWriter are beautiful.
- caycep 12y agoWhat are the advantages over something like pandas? also interesting that NPR is run on flask...
- randallsquared 12y agonpr.org is not run on flask. There are several independent dev teams at NPR: one for npr.org and associated apps like the CMS (where I used to work), one for show production software, one for producing cool standalone apps (where this came from), and one for station-facing apps. I may be forgetting one. They all have their own typical languages: one uses java, scala, and PHP. Another uses drupal. The team that produced this uses python and flask. NPR is diverse. :)
- pixelmonkey 12y agogspread is a little-known Python module that uses the Google Spreadsheet API and offers a simple interface atop it. You don't even need to download the .xlsx file -- you can keep in sync with the file in real-time. https://github.com/burnash/gspread https://github.com/burnash/gspread I use it for some internal proj management tools at Parse.ly.
- staringmonkey 12y agoHey, (I'm the original author of copytext at NPR) this looks like a really nice lib. FWIW, we specifically don't do it this way, because during development we're probably refreshing our page thousands of times and we don't want the delay of hitting the Google servers for every request. Incidentally, that's also why we don't request the spreadsheet in Javascript--the lag time to render the page is too high. We've found our approach gives us a nice balance of "real time" and "practical". Thanks for the comment.
- toomuchtodo 12y agoThank you for open sourcing it!
- dergachev 12y agoNice, thanks for sharing this! Also, I'm exploring simpler alternatives to oauth2 for command-line acccess to the Google Drive SDK, and your password approach is interesting. My current use case is extracting the HTML from a Google Doc and converting that to LaTeX with a custom template: https://github.com/dergachev/gdocs-export https://github.com/dergachev/gdocs-export
- hiphopyo 12y agoThere's https://github.com/nesquena/sheet_mapper https://github.com/nesquena/sheet_mapper too for Ruby.