
NPR open-sources Copytext, a library for handling spreadsheets as Python objects - jsvine
http://copytext.readthedocs.org/en/latest/
======
commandar
Blog post explaining what problem this is meant to solve in more detail:

[http://blog.apps.npr.org/2014/04/21/introducing-copytext-
py....](http://blog.apps.npr.org/2014/04/21/introducing-copytext-py.html)

~~~
001sky
"The spreadsheet is your CMS"

------
pixelmonkey
gspread 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
Hey, (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
Thank you for open sourcing it!

------
pie
Another useful tool for working with spreadsheets in Javascript is SheetJS:
[https://github.com/SheetJS/js-xlsx](https://github.com/SheetJS/js-xlsx)

------
hiphopyo
There's
[https://github.com/nesquena/sheet_mapper](https://github.com/nesquena/sheet_mapper)
too for Ruby.

------
caycep
What are the advantages over something like pandas?

also interesting that NPR is run on flask...

~~~
randallsquared
npr.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. :)

------
stefantalpalaru
It would be nice to mention that this is a wrapper around openpyxl:
[http://pythonhosted.org/openpyxl/](http://pythonhosted.org/openpyxl/)

~~~
cschmidt
I 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.

