--- /tmp/python-xlrd-1.2.0-2x8dqeqgl/debian/python-xlrd-docs_1.2.0-2_all.deb +++ python-xlrd-docs_1.2.0-2_all.deb ├── file list │ @@ -1,3 +1,3 @@ │ -rw-r--r-- 0 0 0 4 2021-01-17 19:56:21.000000 debian-binary │ -rw-r--r-- 0 0 0 1840 2021-01-17 19:56:21.000000 control.tar.xz │ --rw-r--r-- 0 0 0 72880 2021-01-17 19:56:21.000000 data.tar.xz │ +-rw-r--r-- 0 0 0 72884 2021-01-17 19:56:21.000000 data.tar.xz ├── control.tar.xz │ ├── control.tar │ │ ├── ./md5sums │ │ │ ├── ./md5sums │ │ │ │┄ Files differ ├── data.tar.xz │ ├── data.tar │ │ ├── file list │ │ │ @@ -22,34 +22,34 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 4256 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/_static/classic.css │ │ │ -rw-r--r-- 0 root (0) root (0) 355 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/_static/documentation_options.js │ │ │ -rw-r--r-- 0 root (0) root (0) 286 2021-01-01 06:53:29.000000 ./usr/share/doc/python-xlrd-docs/_static/file.png │ │ │ -rw-r--r-- 0 root (0) root (0) 90 2021-01-01 06:53:29.000000 ./usr/share/doc/python-xlrd-docs/_static/minus.png │ │ │ -rw-r--r-- 0 root (0) root (0) 90 2021-01-01 06:53:29.000000 ./usr/share/doc/python-xlrd-docs/_static/plus.png │ │ │ -rw-r--r-- 0 root (0) root (0) 4780 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/_static/pygments.css │ │ │ -rw-r--r-- 0 root (0) root (0) 5191 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/acknowledgements.html │ │ │ --rw-r--r-- 0 root (0) root (0) 173828 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/api.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 173836 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/api.html │ │ │ -rw-r--r-- 0 root (0) root (0) 2247 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/changelog.Debian.gz │ │ │ -rw-r--r-- 0 root (0) root (0) 7578 2018-12-15 17:47:07.000000 ./usr/share/doc/python-xlrd-docs/changelog.gz │ │ │ --rw-r--r-- 0 root (0) root (0) 35278 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/changes.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 35279 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/changes.html │ │ │ -rw-r--r-- 0 root (0) root (0) 3501 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/copyright │ │ │ --rw-r--r-- 0 root (0) root (0) 12103 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/dates.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 12104 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/dates.html │ │ │ -rw-r--r-- 0 root (0) root (0) 8086 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/development.html │ │ │ -rw-r--r-- 0 root (0) root (0) 13232 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/formatting.html │ │ │ -rw-r--r-- 0 root (0) root (0) 35363 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/genindex.html │ │ │ -rw-r--r-- 0 root (0) root (0) 6366 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 5312 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/installation.html │ │ │ -rw-r--r-- 0 root (0) root (0) 7727 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/licenses.html │ │ │ -rw-r--r-- 0 root (0) root (0) 2220 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/objects.inv │ │ │ --rw-r--r-- 0 root (0) root (0) 11307 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/on_demand.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 11310 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/on_demand.html │ │ │ -rw-r--r-- 0 root (0) root (0) 4887 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/py-modindex.html │ │ │ -rw-r--r-- 0 root (0) root (0) 8673 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/references.html │ │ │ -rw-r--r-- 0 root (0) root (0) 3310 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/search.html │ │ │ -rw-r--r-- 0 root (0) root (0) 28469 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/searchindex.js │ │ │ --rw-r--r-- 0 root (0) root (0) 6847 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/unicode.html │ │ │ --rw-r--r-- 0 root (0) root (0) 7448 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/vulnerabilities.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 6848 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/unicode.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 7449 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/vulnerabilities.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2021-01-17 19:56:21.000000 ./usr/share/doc-base/ │ │ │ -rw-r--r-- 0 root (0) root (0) 277 2021-01-17 19:56:21.000000 ./usr/share/doc-base/python-xlrd │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/_static/doctools.js -> ../../../javascript/sphinxdoc/1.0/doctools.js │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/_static/jquery.js -> ../../../javascript/sphinxdoc/1.0/jquery.js │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/_static/language_data.js -> ../../../javascript/sphinxdoc/1.0/language_data.js │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/_static/searchtools.js -> ../../../javascript/sphinxdoc/1.0/searchtools.js │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2021-01-17 19:56:21.000000 ./usr/share/doc/python-xlrd-docs/_static/sidebar.js -> ../../../javascript/sphinxdoc/1.0/sidebar.js │ │ ├── ./usr/share/doc/python-xlrd-docs/api.html │ │ │ @@ -59,15 +59,15 @@ │ │ │
logfile – An open file to which messages and diagnostics are written.
verbosity – Increases the volume of trace material written to the │ │ │ logfile.
use_mmap –
Whether to use the mmap module is determined heuristically. │ │ │ Use this arg to override the result.
│ │ │Current heuristic: mmap is used if it exists.
│ │ │file_contents – A string or an mmap.mmap
object or some other behave-alike
│ │ │ +
file_contents – A string or an mmap.mmap
object or some other behave-alike
│ │ │ object. If file_contents
is supplied, filename
will not be used,
│ │ │ except (possibly) in messages.
encoding_override – Used to overcome missing or bad codepage information │ │ │ in older-version files. See Handling of Unicode.
formatting_info –
The default is False
, which saves memory.
│ │ │ In this case, “Blank” cells, which are those with their own formatting
│ │ │ information but no data, are treated as empty by ignoring the file’s
│ │ │ @@ -515,15 +515,15 @@
│ │ │
│ │ │
│ │ │
release_resources
()¶This method has a dual purpose. You can call it to release
│ │ │ memory-consuming objects and (possibly) a memory-mapped file
│ │ │ -(mmap.mmap
object) when you have finished loading sheets in
│ │ │ +(mmap.mmap
object) when you have finished loading sheets in
│ │ │ on_demand
mode, but still require the Book
object to
│ │ │ examine the loaded sheets. It is also called automatically (a) when
│ │ │ open_workbook()
│ │ │ raises an exception and (b) if you are using a with
statement, when
│ │ │ the with
block is exited. Calling this method multiple times on the
│ │ │ same object has no ill effect.
xlrd.compdoc.
CompDoc
(mem, logfile=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, DEBUG=0)¶Compound document handler.
│ │ │mem – The raw contents of the file, as a string, or as an mmap.mmap
│ │ │ +
mem – The raw contents of the file, as a string, or as an mmap.mmap
│ │ │ object. The only operation it needs to support is slicing.
get_named_stream
(qname)¶Interrogate the compound document’s directory; return the stream as a │ │ │ @@ -1351,15 +1351,15 @@ │ │ │
where 0 <= thingxlo <= thingx < thingxhi
.
Note
│ │ │It is quite possible to have thingx > nthings
; for example
│ │ │ Print_Titles
could have colxhi == 256
and/or rowxhi == 65536
│ │ │ irrespective of how many columns/rows are actually used in the worksheet.
│ │ │ The caller will need to decide how to handle this situation.
│ │ │ -Keyword: IndexError
:-)
IndexError
:-)
│ │ │ The components of the coords attribute are also available as individual
│ │ │ attributes: shtxlo
, shtxhi
, rowxlo
, rowxhi
, colxlo
, and
│ │ │ colxhi
.
The relflags
attribute is a 6-tuple of flags which indicate whether
│ │ │ the corresponding (sheet|row|col)(lo|hi) is relative (1) or absolute (0).
url_or_path
= None¶The URL or file-path, depending in the type. Unicode string, except
│ │ │ in the rare case of a local but non-existent file with non-ASCII
│ │ │ characters in the name, in which case only the “8.3” filename is
│ │ │ -available, as a bytes
(3.x) or str
(2.x) string,
│ │ │ +available, as a bytes
(3.x) or str
(2.x) string,
│ │ │ with unknown encoding.
desc
= None¶Description. │ │ │ @@ -2323,24 +2323,24 @@ │ │ │ system; its “serial number” is zero.
│ │ │xlrd.xldate.
xldate_as_datetime
(xldate, datemode)¶Convert an Excel date/time number into a datetime.datetime
object.
Convert an Excel date/time number into a datetime.datetime
object.
xldate – The Excel number
datemode – 0: 1900-based, 1: 1904-based.
A datetime.datetime
object.
A datetime.datetime
object.
xlrd.xldate.
xldate_from_date_tuple
(date_tuple, datemode)¶Fix for “invalid literal for int() with base 10: ‘true’” when reading some │ │ │ xlsx files.
Make xldate_as_datetime available to import direct from xlrd.
Build universal wheels.
Sphinx documentation.
Document the problem with XML vulnerabilities in xlsx files and mitigation │ │ │ measures.
Fix NameError
on has_defaults is not defined
.
Fix NameError
on has_defaults is not defined
.
Some whitespace and code style tweaks.
Make example in README compatible with both Python 2 and 3.
Add default value for cells containing errors that causeed parsing of some │ │ │ xlsx files to fail.
Add Python 3.6 to the list of supported Python versions, drop 3.3 and 2.6.
Use generator expressions to avoid unnecessary lists in memory.
Document unicode encoding used in Excel files from Excel 97 onwards.
The Macintosh-default 1904-based date system counts 1904-01-02
as day 1
│ │ │ and 1904-01-01
as day zero. Thus any number such that
│ │ │ (0.0 <= number < 1.0)
is ambiguous. Is 0.625 a time of day
│ │ │ (15:00:00
), independent of the calendar, or should it be interpreted as
│ │ │ an instant on a particular day (1904-01-01T15:00:00
)?
The functions in xldate
take the view that such a number is a
│ │ │ -calendar-independent time of day (like Python’s datetime.time
type)
│ │ │ +calendar-independent time of day (like Python’s datetime.time
type)
│ │ │ for both date systems. This is consistent with more recent Microsoft
│ │ │ documentation. For example, the help file for Excel 2002, which says that the
│ │ │ first day in the 1904 date system is 1904-01-02
.
Usage of the Excel DATE()
function may leave strange dates in a
│ │ │ spreadsheet. Quoting the help file in respect of the 1900 date system:
If year is between 0 (zero) and 1899 (inclusive),
│ │ ├── ./usr/share/doc/python-xlrd-docs/on_demand.html
│ │ │ @@ -49,15 +49,15 @@
│ │ │ This feature, new in version 0.7.1, is governed by the on_demand
argument
│ │ │ to the open_workbook()
function and allows saving memory and time by
│ │ │ loading only those sheets that the caller is interested in, and releasing sheets
│ │ │ when no longer required.
│ │ │
on_demand=False
(default):No change. open_workbook()
loads global data
│ │ │ and all sheets, releases resources no longer required (principally the
│ │ │ -str
or mmap.mmap
object containing the Workbook stream),
│ │ │ +str
or mmap.mmap
object containing the Workbook stream),
│ │ │ and returns.
on_demand=True
and BIFF version < 5.0:A warning message is emitted,
│ │ │ on_demand
is recorded as False
, and the old process is followed.
on_demand=True
and BIFF version >= 5.0:open_workbook()
loads global
│ │ │ data and returns without releasing resources. At this stage, the only
│ │ │ @@ -79,15 +79,15 @@
│ │ │
The caller may query the state of a sheet using Book.sheet_loaded()
.
Book.release_resources()
may used to save memory and close
│ │ │ any memory-mapped file before proceeding to examine already-loaded
│ │ │ sheets. Once resources are released, no further sheets can be loaded.
When using on-demand, it is advisable to ensure that
│ │ │ Book.release_resources()
is always called, even if an exception
│ │ │ is raised in your own code; otherwise if the input file has been
│ │ │ -memory-mapped, the mmap.mmap
object will not be closed and you will
│ │ │ +memory-mapped, the mmap.mmap
object will not be closed and you will
│ │ │ not be able to access the physical file until your Python process
│ │ │ terminates. This can be done by calling Book.release_resources()
│ │ │ explicitly in the finally part of a try/finally block.
The Book object is also a context manager, so you can wrap your code in a
│ │ │ with
statement that will make sure underlying resources are closed.
CODEPAGE
record provides a codepage number (for example, 1252) which is
│ │ │ used by xlrd to derive the encoding (for same example: “cp1252”) which is
│ │ │ used to translate to Unicode.
│ │ │ If the CODEPAGE
record is missing (possible if the file was created
│ │ │ by third-party software), xlrd
will assume that the encoding is ascii,
│ │ │ and keep going. If the actual encoding is not ascii, a
│ │ │ -UnicodeDecodeError
exception will be raised and
│ │ │ +UnicodeDecodeError
exception will be raised and
│ │ │ you will need to determine the encoding yourself, and tell xlrd:
book = xlrd.open_workbook(..., encoding_override="cp1252")
│ │ │
If the CODEPAGE
record exists but is wrong (for example, the codepage
│ │ │ number is 1251, but the strings are actually encoded in koi8_r),
│ │ │ it can be overridden using the same mechanism.
If your code ingests .xlsx
files that come from sources in which you do not
│ │ │ have absolute trust, please be aware that .xlsx
files are made up of XML
│ │ │ and, as such, are susceptible to the vulnerabilities of XML.
xlrd uses ElementTree to parse XML, but as you’ll find if you look into it, │ │ │ there are many different ElementTree implementations. A good summary │ │ │ of vulnerabilities you should worry can be found here: │ │ │ -XML vulnerabilities.
│ │ │ +XML vulnerabilities. │ │ │For clarity, xlrd will try and import ElementTree from the following sources. │ │ │ The list is in priority order, with those earlier in the list being preferred │ │ │ to those later in the list:
│ │ │