xlrd Python 3 support

869 views
Skip to first unread message

Thomas Kluyver

unread,
May 12, 2012, 9:11:33 AM5/12/12
to python...@googlegroups.com
If anyone has got time to do some testing, I have a branch of xlrd that supports Python 2 and 3. It's up to date with master, and passing all tests here, but more verification is always welcome. Even if you don't use Python 3, it's important to check that it doesn't break anything on Python 2.

It can be downloaded from:
https://github.com/takluyver/xlrd/zipball/py3

Or you can browse the current state of the code here:
https://github.com/takluyver/xlrd/tree/py3

Note that this is a development branch, and I don't recommend you use it in a production environment. It is not officially supported, although I'll do my best to fix any bugs I hear about.

Thanks,
Thomas

Thomas Kluyver

unread,
Jul 21, 2012, 7:37:26 AM7/21/12
to python...@googlegroups.com
On 20 July 2012 12:02, Alexander Ortenburger <orten...@gmail.com> wrote:
> I'm using your port regularly, up to now I didn't find any bugs. (xslm and
> xls files)
> Imho it should be merged to master.

Thanks Alexander, it's great to have some real-world testing.

> A nice feature would be to parse csv-files the same way so that you do not
> have to switch between two readers.

That's an interesting idea - I guess the way to do that would be to
provide a wrapper that behaved like csv.reader in the Python standard
library.

Depending on what you need it for, you could also look at pandas,
which can read csv or xls files (using xlrd) into a common DataFrame
structure. There's documentation here:
http://pandas.pydata.org/pandas-docs/stable/io.html

Best wishes,
Thomas

PythonDevDang

unread,
Jul 21, 2012, 12:25:16 PM7/21/12
to python...@googlegroups.com
This is a busy weekend for me, but I will definitely be checking this out in the near future.
I have been waiting for a Python 3 version. I tried it myself, before joining this group/list,
but without success.
Thank you for your effort--I know it was a lot of work!
    --dang

Thomas Kluyver

unread,
Jul 21, 2012, 1:49:15 PM7/21/12
to python...@googlegroups.com
On 21 July 2012 17:25, PythonDevDang <daniel.dan...@gmail.com> wrote:
> This is a busy weekend for me, but I will definitely be checking this out in
> the near future.
> I have been waiting for a Python 3 version. I tried it myself, before
> joining this group/list,
> but without success.
> Thank you for your effort--I know it was a lot of work!

You're welcome, but most of the credit should go to Manfred Moitzi -
he originally made the Python 3 port (as xlrd3). I largely just
adapted that so the same codebase could support Python 2 and 3, and
fixed a few things. Manfred also took the time to write a lot of
tests, which made my part much easier.

Best wishes,
Thomas

Jack Dwyer

unread,
Dec 6, 2013, 12:02:15 AM12/6/13
to python...@googlegroups.com
Thanks, this looks good.
im considering migrating some of my stuff to py3, and xlrd is supported :)
I'll run some test cases against it, but cheers!

Chris Withers

unread,
Dec 6, 2013, 1:32:43 AM12/6/13
to python...@googlegroups.com
...or you could just use a recent release of xlrd from pypi, which has
supported Python 3 for some time now:

http://jenkins.simplistix.co.uk/view/python-excel/job/xlrd/

Chris
> --
> You received this message because you are subscribed to the Google
> Groups "python-excel" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to python-excel...@googlegroups.com.
> To post to this group, send an email to python...@googlegroups.com.
> Visit this group at http://groups.google.com/group/python-excel.
> For more options, visit https://groups.google.com/groups/opt_out.
>
> ______________________________________________________________________
> This email has been scanned by the Symantec Email Security.cloud service.
> For more information please visit http://www.symanteccloud.com
> ______________________________________________________________________

--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
Reply all
Reply to author
Forward
0 new messages