Message from discussion
xlrd-0.8.0 .xlsx formatting_info=True not implemented
Received: by 10.66.84.199 with SMTP id b7mr758262paz.11.1346295488578;
Wed, 29 Aug 2012 19:58:08 -0700 (PDT)
X-BeenThere: python-excel@googlegroups.com
Received: by 10.68.237.161 with SMTP id vd1ls7631820pbc.3.gmail; Wed, 29 Aug
2012 19:58:05 -0700 (PDT)
Received: by 10.66.74.69 with SMTP id r5mr703342pav.12.1346295485887;
Wed, 29 Aug 2012 19:58:05 -0700 (PDT)
Received: by 10.66.74.69 with SMTP id r5mr703341pav.12.1346295485877;
Wed, 29 Aug 2012 19:58:05 -0700 (PDT)
Return-Path: <r...@pooka.fabcat.org>
Received: from pooka.fabcat.org (pooka.fabcat.org. [114.31.201.3])
by gmr-mx.google.com with ESMTP id p7si299908pby.0.2012.08.29.19.58.05;
Wed, 29 Aug 2012 19:58:05 -0700 (PDT)
Received-SPF: pass (google.com: domain of r...@pooka.fabcat.org designates 114.31.201.3 as permitted sender) client-ip=114.31.201.3;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of r...@pooka.fabcat.org designates 114.31.201.3 as permitted sender) smtp.mail=...@pooka.fabcat.org
Received: from localhost (localhost [127.0.0.1])
by pooka.fabcat.org (Postfix) with ESMTP id A65CC41003D;
Thu, 30 Aug 2012 12:58:03 +1000 (EST)
X-Virus-Scanned: Debian amavisd-new at pooka.fabcat.org
Received: from pooka.fabcat.org ([127.0.0.1])
by localhost (pooka.fabcat.org [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id xhsDekMSOpXJ; Thu, 30 Aug 2012 12:57:59 +1000 (EST)
Received: by pooka.fabcat.org (Postfix, from userid 1000)
id E12CD4103D7; Thu, 30 Aug 2012 12:57:58 +1000 (EST)
Date: Thu, 30 Aug 2012 12:57:58 +1000
From: python-ex...@raf.org
To: python-excel@googlegroups.com, Python List <python-l...@python.org>
Subject: Re: [pyxl] xlrd-0.8.0 .xlsx formatting_info=True not implemented
Message-ID: <20120830025758.GA26856@raf.org>
Mail-Followup-To: python-excel@googlegroups.com,
Python List <python-l...@python.org>
References: <501944E4.2090902@simplistix.co.uk>
<CA+GpVts=-cmJutJxM2KYC-oZ3+FyKpZ5WLzubtUiOY9Nu7Mxiw@mail.gmail.com>
<5c84fd3b-c899-4703-867d-ddbc5d1746de@googlegroups.com>
<20120829021646.GA8...@raf.org>
<CAA2zXtBmev_8w60d236FhxESKNyp3mVRfiv9vqNZ7bWrW9R...@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CAA2zXtBmev_8w60d236FhxESKNyp3mVRfiv9vqNZ7bWrW9R...@mail.gmail.com>
John Yeung wrote:
> > is there any other way to tell how many digits excel would round to
> > when displaying a floating point number? that's my only reason for
> > needing formatting_info=True.
>
> I have not personally used it, but OpenPyXL is another option for
> working with .xlsx files, and it might provide the formatting info you
> need:
>
> http://packages.python.org/openpyxl/index.html
> http://pypi.python.org/pypi/openpyxl/1.5.8
>
> John Y.
thanks but openpyxl doesn't work well enough.
most of the spreadsheets i need to read contain
dropdown lists with data validation using a named
formula like: OFFSET(Data!$K$2,0,0,COUNTA(Data!$K:$K),1)
which causes openpyxl to throw a NamedRangeException.
i don't even care about the named objects. i just want
to know what's in the cell, not what other possible
values the cell might have had. :-)
apart from that, it does give access to number formats
so your suggestion would work for simpler spreadsheets.
hopefully the intention that xlrd not support formats in xlsx
files will change one day into an intention to support them. :-)
until then my users can keep manually saving xlsx files they
receive as xls before importing them. :-(
maybe i need to investigate some perl modules or pyuno instead.
perl's Spreadsheet::XSLX module handles formats. it gets the
date formats a bit wrong but it's workaroundable.
cheers,
raf