Live data from Hacker News

Use Python in Excel without add-ins

xlwings.org

31–40 of 73 posts

Re: Use Python in Excel without add-ins

#31
Well I did a quick look for F# and C# tools like this and found

http://blogs.msdn.com/b/fsharpteam/archive/2013/07/16/combin...

Interesting usage. Personally I try to use CSV and code in R. R has libraries where I can pull information in BUT I am always afraid of issues with a non-open file format.

In the Universe of everything is done in Word and I am hard pressed to get people to even use Excel these approaches might make my job easier.

Re: Use Python in Excel without add-ins

#35
post #4

Not the same thing, but this made me think about it and readers might be interested to know that the xlrd, xlwt and xlutils python modules ( http://www.python-excel.org/ ) allow you to manipulate Excel files in Python, without even having Excel installed (it's pure Python, so it also works on Linux, for example).

Looks like xlrd may have been updated to read newer formats, but xlwt is still limited and cannot write .xlsx format spreadsheets, for example. openpyxl _can_ handle the newer formats, but only the newer formats. It's a bit of a mess.

It is a bit of a mess; documentation often amounting to a few example calls. However, I've written a fairly well received data analysis package for a government department wherein the input and output had to be in excel spreadsheets (-sigh-), using only xlrd and xlwt, alongside numpy and scipy. It's a bit Rubegoldbergian (because.. excel), but I owe a lot to the authors of xlrd and xlwt (they've even supported named regions). So i'll be curious to see how xlwings implements the numerous methods available from xlrd/xlwt.

Re: Use Python in Excel without add-ins

#36
post #3

I am guessing DataNitro isn't happy about this

Not at all, it's great to see more products helping people get away from VBA. xlwings is well-done and has some features we don't (e.g. Mac interop), and likewise we have some features they don't (e.g. UDF's). (I'm one of the DataNitro founders.)

Have you considered Mac interop?

Re: Use Python in Excel without add-ins

#37
Very nice indeed. My team do statistical work, usually delivered in Excel, and we're going to be focused on automation / productivity quite heavily in the next few months. I need to put this through its paces a bit more than putting 'Hello World' in A1 - but it raises the tantalising prospect of a bunch of R and VBA work turning into a bunch of R and Python work.

Re: Use Python in Excel without add-ins

#38
Awesome to see a FOSS solution for this.

Ben at DataNitro[1], a paid solution that's been around for a while, has been awesome in my occasional correspondence with him as a user. Anyone looking for xlwing's functionality with commercial support etc should give them a look.

[1] https://datanitro.com/

Re: Use Python in Excel without add-ins

#40
post #6

This is fantastic - I am going to start testing it now. I write a fair amount of VB macros, and would much prefer to be able to use Python. And, if they could create a plugin that allowed Libre Office to do the same, they could solve one of the last remaining major interoperability issues with LO and Excel: the inability to run VB macros in LO. That would be huge.

LibreOffice has python support http://api.libreoffice.org/examples/examples.html
Post reply on HN