[Python-modules-commits] [python-xlrd] 01/09: Import python-xlrd_1.0.0.orig.tar.gz

Vincent Bernat bernat at moszumanska.debian.org
Sun Jul 3 18:22:02 UTC 2016


This is an automated email from the git hooks/post-receive script.

bernat pushed a commit to branch master
in repository python-xlrd.

commit f69908a2e1d3f0830935125b170fc1d556308fd8
Author: Vincent Bernat <bernat at debian.org>
Date:   Sun Jul 3 19:50:23 2016 +0200

    Import python-xlrd_1.0.0.orig.tar.gz
---
 .gitignore                            |   15 +
 .travis.yml                           |   32 +
 HISTORY.html                          |  339 ++++++++
 MANIFEST.in                           |    2 +
 PKG-INFO                              |    2 +-
 README.html                           |  135 ----
 README.md                             |   82 ++
 build.txt                             |   12 +
 make_doc.bat                          |    6 +
 pkg_doc.py                            |   31 +
 pythondoc.py                          | 1428 +++++++++++++++++++++++++++++++++
 requirements.txt                      |   15 +
 setup.cfg                             |    5 +
 setup.py                              |    9 +-
 tests/apachepoi_52348.xlsx            |  Bin 0 -> 5292 bytes
 tests/biff4_no_format_no_window2.xls  |  Bin 0 -> 2810 bytes
 tests/issue150.xlsx                   |  Bin 0 -> 99016 bytes
 tests/issue85.xls                     |  Bin 0 -> 9090560 bytes
 tests/test_cell.py                    |   10 +
 tests/test_comments_excel_sheet2.xlsx |  Bin 0 -> 32180 bytes
 tests/test_missing_records.py         |   22 +
 tests/test_open_workbook.py           |   10 +-
 tests/test_sheet.py                   |   12 +
 tests/test_xlsx_comments.py           |    9 +
 tests/test_xlsx_parse.py              |   31 +
 tox.ini                               |   13 +
 PKG-INFO => xlrd.egg-info/PKG-INFO    |    2 +-
 xlrd.egg-info/SOURCES.txt             |   67 ++
 xlrd.egg-info/dependency_links.txt    |    1 +
 xlrd.egg-info/top_level.txt           |    1 +
 xlrd/__init__.py                      |    8 +-
 xlrd/compdoc.py                       |    8 +-
 xlrd/formatting.py                    |   14 +-
 xlrd/info.py                          |    2 +-
 xlrd/sheet.py                         |   32 +-
 xlrd/xlsx.py                          |   78 +-
 36 files changed, 2236 insertions(+), 197 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..6117420
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,15 @@
+/build
+/dist
+*.egg-info
+build/
+*.pyc
+/.coverage
+/.tox
+/*.xml
+/htmlcov
+MANIFEST
+/bin
+.Python
+/include
+/lib
+
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..aad6d52
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,32 @@
+# for container-y goodness:
+sudo: false
+
+language: python
+
+python:
+  - "3.5"
+  - "3.4"
+  - "3.3"
+  - "2.7"
+  - "2.6"
+
+# command to install dependencies
+install: "pip install -Ur requirements.txt"
+
+# command to run tests, e.g. python setup.py test
+script: nosetests --with-cov --cov=xlrd
+
+after_success:
+  - coveralls
+
+deploy:
+  provider: pypi
+  user: chrisw
+  password:
+    secure: BManEisxNCN966HPz8J/oYzFBPuTPFP212d8rUjv9p/W96pT0zWlO9paDce67nZiYWb7Khzg7fF5WSFpYRKsvB4a370KpTYbsAb8EPx7DUBPsz7qFC8B6EUbCXfwbe68XwPugenREby8vEtywUqxzge2SNVRPfH+wKio2hUcfEo=
+  on:
+    tags: true
+    repo: python-excel/xlrd
+    python: "3.5"
+  skip_cleanup: true
+  distributions: "sdist bdist_wheel"
diff --git a/HISTORY.html b/HISTORY.html
new file mode 100644
index 0000000..32f2635
--- /dev/null
+++ b/HISTORY.html
@@ -0,0 +1,339 @@
+TODO -- refer to svn log if you really need to know :-)
+
+<p> Revision : 3782 -- Author: sjmachin -- Date: 2009-02-23 23:00:50
+</p><ul>
+     <li> colname utility function now supports more than 256 columns.
+</li><li> Fix bug where BIFF record type 0x806 was being regarded as a formula opcode.
+</li><li> Ignore PALETTE record when formatting_info is false.
+</li><li> Tolerate up to 4 bytes trailing junk on PALETTE record.
+</li><li> Fixed bug in unused utility function xldate_from_date_tuple which affected some years after 2099.
+</li><li> Added code for inspecting as-yet-unused record types: FILEPASS, TXO, NOTE.
+</li><li> Added inspection code for add_in function calls.
+</li><li> Added support for unnumbered biff_dump (better for doing diffs).
+</li></ul>
+<p> Revision : 3613 -- Author: chris -- Date: 2008-11-22 04:06:36
+</p><ul>
+     <li> ignore distutils cruft
+</li></ul>
+<p> Revision : 3574 -- Author: sjmachin -- Date: 2008-11-04 11:51:20
+</p><ul>
+     <li> Avoid assertion error in compdoc when -1 used instead of -2 for first_SID of empty SCSS
+</li></ul>
+<p> Revision : 3480 -- Author: chris -- Date: 2008-09-19 20:43:00
+</p><ul>
+     <li> Make version numbers match up.
+</li></ul>
+<p> Revision : 3431 -- Author: sjmachin -- Date: 2008-07-28 10:37:35
+</p><ul>
+     <li> Enhanced recovery from out-of-order/missing/wrong CODEPAGE record.
+</li><li> Added Name.area2d convenience method.
+</li><li> Avoided some checking of XF info when formatting_info is false.
+</li><li> Minor changes in preparation for XLSX support.
+</li></ul>
+<p> Revision : 3311 -- Author: chris -- Date: 2008-03-14 22:09:01
+</p><ul>
+     <li> remove duplicate files that were out of date.
+</li></ul>
+<p> Revision : 3287 -- Author: sjmachin -- Date: 2008-02-14 06:33:32
+</p><ul>
+     <li> Basic support for Excel 2.0
+</li></ul>
+<p> Revision : 3284 -- Author: sjmachin -- Date: 2008-02-09 05:37:57
+</p><ul>
+     <li> Decouple Book init & load.
+</li><li> runxlrd: minor fix for xfc.
+</li><li> More Excel 2.x work.
+</li><li> is_date_format() tweak.
+</li><li> Better detection of IronPython.
+</li></ul>
+<p> Revision : 3265 -- Author: sjmachin -- Date: 2007-12-25 19:09:45
+</p><ul>
+     <li> Better error message (including first 8 bytes of file) when file is not in a supported format.
+</li></ul>
+<p> Revision : 3263 -- Author: sjmachin -- Date: 2007-12-20 07:04:55
+</p><ul>
+     <li> More BIFF2 formatting: ROW, COLWIDTH, and COLUMNDEFAULT records;
+</li><li> finished stage 1 of XF records.
+</li></ul>
+<p> Revision : 3262 -- Author: sjmachin -- Date: 2007-12-11 07:40:33
+</p><ul>
+     <li> More work on supporting BIFF2 (Excel 2.x) files.
+</li></ul>
+<p> Revision : 3250 -- Author: sjmachin -- Date: 2007-12-04 20:37:14
+</p><ul>
+     <li> Added support for Excel 2.x (BIFF2) files. Data only, no formatting info. Alpha.
+</li></ul>
+<p> Revision : 3234 -- Author: sjmachin -- Date: 2007-11-21 00:55:56
+</p><ul>
+     <li> Wasn't coping with EXTERNSHEET record followed by CONTINUE record(s).
+</li></ul>
+<p> Revision : 3168 -- Author: sjmachin -- Date: 2007-10-13 09:19:01
+</p><ul>
+     <li> Allow for BIFF2/3-style FORMAT record in BIFF4/8 file
+</li><li> Avoid crash when zero-length Unicode string missing options byte.
+</li><li> Warning message if sector sizes are extremely large.
+</li><li> Work around corrupt STYLE record
+</li><li> Added missing entry for blank cell type to ctype_text
+</li><li> Added "fonts" command to runxlrd script
+</li><li> Warning: style XF whose parent XF index != 0xFFF
+</li></ul>
+<p> Revision : 2868 -- Author: sjmachin -- Date: 2007-07-11 11:02:55
+</p><ul>
+     <li> Logfile arg wasn't being passed from open_workbook to compdoc.CompDoc.
+</li></ul>
+
+<p>  Version 0.6.1, 2007-06-10
+</p>
+<ul>
+<li> Version number updated to 0.6.1
+</li>
+<li> Documented runxlrd.py commands in its usage message. Changed commands: dump to biff_dump, count_records to biff_count.
+</li>
+</ul>
+
+<p>  Version 0.6.1a5
+</p>
+<ul>
+<li> Bug fixed: Missing "<" in a struct.unpack call means can't open files on bigendian platforms. Discovered by "Mihalis".
+</li>
+<li> Removed antique undocumented Book.get_name_dict method and experimental "trimming" facility.
+</li>
+<li> Meaningful exception instead of IndexError if a SAT (sector allocation table) is corrupted.
+</li>
+<li> If no CODEPAGE record in pre-8.0 file, assume ascii and keep going (instead of raising exception).
+</li>
+</ul>
+
+<p>  Version 0.6.1a4
+</p>
+<ul>
+<li> At least one source of XLS files writes parent style XF records *after* the child cell
+     XF records that refer to them, triggering IndexError in 0.5.2 and AssertionError in
+     later versions.
+     Reported with sample file by Todd O'Bryan.
+     Fixed by changing to two-pass processing of XF records.
+</li>
+<li> Formatting info in pre-BIFF8 files: Ensured appropriate defaults and lossless conversions to make
+     the info BIFF8-compatible. Fixed bug in extracting the "used" flags.
+</li>
+<li> Fixed problems discovered with opening test files from Planmaker 2006
+     (http://www.softmaker.com/english/ofwcomp_en.htm):
+     (1) Four files have reduced size of PALETTE record
+     (51 and 32 colours; Excel writes 56 always). xlrd now emits a NOTE to the logfile and continues.
+     (2) FORMULA records use the Excel 2.x record code 0x0021 instead of 0x0221. xlrd now continues silently.
+     (3) In two files, at the OLE2 compound document level, the internal directory says that the length of
+     the Short-Stream Container Stream is 16384 bytes, but the actual contents are 11264 and 9728 bytes respectively.
+     xlrd now emits a WARNING to the logfile and continues.
+</li>
+<li> After discussion with Daniel Rentz, the concept of two lists of XF (eXtended Format) objects
+     (raw_xf_list and computed_xf_list) has been abandoned. There is now a single list, called xf_list
+</li>
+</ul>
+
+<p>  Version 0.6.1a3
+</p>
+<ul>
+<li> Added Book.sheets ... for sheetx, sheet in enumerate(book.sheets):
+</li>
+<li> Formatting info: extraction of sheet-level flags from WINDOW2 record, and sheet.visibility
+     from BOUNDSHEET record. Added Macintosh-only Font attributes "outline" and "shadow'.
+</li>
+</ul>
+
+<p>  Version 0.6.1a2
+</p>
+<ul>
+<li> Added extraction of merged cells info.
+</li>
+<li> pyExcelerator uses "general" instead of "General" for the generic "number format". Worked around.
+</li>
+<li> Crystal Reports writes "WORKBOOK" in the OLE2 Compound Document directory instead of "Workbook".
+     Changed to case-insensitive directory search. Reported by Vic Simkus.
+</li>
+</ul>
+
+<p>  Version 0.6.1a1, 2006-12-18
+</p>
+<ul>
+<li> Added formatting information for cells (font, "number format", background, border, alignment and protection)
+     and rows/columns (height/width etc). To save memory and time for those who don't need it,
+     this information is extracted only if formatting_info=1 is supplied
+     to the open_workbook() function. The cell records BLANK and MULBLANKS
+     which contain no data, only formatting information, will continue to be ignored
+     in the default (no formatting info) case.
+</li>
+<li> Ralph Heimburger reported a problem with xlrd being intolerant
+     about an Excel 4.0 file (created by "some web app") with a DIMENSIONS record
+     that omitted Microsoft's usual padding with 2 unused bytes. Fixed.
+</li>
+</ul>
+
+<p>  Version 0.6.0a4, not released
+</p>
+<ul>
+<li> Added extraction of human-readable formulas from NAME records.
+</li>
+<li> Worked around OOo Calc writing 9-byte BOOLERR records instead of 8. Reported by Rory Campbell-Lange.
+</li>
+<li> This history file converted to descending chronological order and HTML format.
+</li>
+</ul>
+
+<p>  Version 0.6.0a3, 2006-09-19
+</p>
+<ul>
+<li> Names: minor bugfixes; added script xlrdnameAPIdemo.py
+</li>
+<li> ROW records were being used as additional hints for sizing memory requirements. In some
+     files the ROW records overstate the number of used columns, and/or there are ROW records for
+     rows that have no data in them. This would cause xlrd to report sheet.ncols and/or sheet.nrows
+     as larger than reasonably expected. Change: ROW records are ignored. The number of columns/rows is
+     based solely on the highest column/row index seen in non-empty data records. Empty data records (types
+     BLANK and MULBLANKS) which contain no data, only formatting information, have always been ignored, and
+     this will continue. Consequence: trailing rows and columns which contain only empty cells will
+     vanish.
+</li>
+</ul>
+
+<p>  Version 0.6.0a2, 2006-09-13
+</p>
+<ul>
+<li> Fixed a bug reported by Rory Campbell-Lange.: "open failed"; incorrect assumptions about the layout
+     of array formulas which return strings.
+</li>
+<li> Further work on defined names, especially the API.
+</li>
+</ul>
+
+<p>  Version 0.6.0a1, 2006-09-08
+</p>
+<ul>
+<li> Sheet objects have two new convenience methods: col_values(colx, start_rowx=0, end_rowx=None)
+     and the corresponding col_types. Suggested by Dennis O'Brien.
+</li>
+<li> BIFF 8 file missing its CODEPAGE record: xlrd will now assume utf_16_le encoding
+     (the only possibility) and keep going.
+</li>
+<li> Older files missing a CODEPAGE record: an exception will be raised.
+     Thanks to Sergey Krushinsky for a sample file.
+     The open_workbook() function has a new argument (encoding_override) which can
+     be used if the CODEPAGE record is missing or incorrect (for example, codepage=1251
+     but the data is actually encoded in koi8_r). The runxlrd.py script takes a
+     corresponding -e argument, for example -e cp1251
+</li>
+<li> Further work done on parsing "number formats". Thanks to Chris Withers for the
+     "General_)" example.
+</li>
+<li> Excel 97 introduced the concept of row and column labels, defined by Insert > Name > Labels.
+     The ranges containing the labels are now exposed as the Sheet attributes
+     row_label_ranges and col_label_ranges.
+</li>
+<li> The major effort in this 0.6.0 release has been the provision of access
+     to named cell ranges and named constants (Excel: Insert/Name/Define).
+     Juan C. M�ndez provided very useful real-world sample files.
+</li>
+</ul>
+
+<p>  Version 0.5.3a1, 2006-05-24
+</p>
+<ul>
+<li> John Popplewell and Richard Sharp provided sample files which caused any
+     reliance at all on DIMENSIONS records and ROW records to be abandoned.
+</li>
+<li> If the file size is not a whole number of OLE sectors, a warning message is logged.
+     Previously this caused an exception to be raised.
+</li>
+</ul>
+
+<p>  Version 0.5.2, 2006-03-14, public release
+</p>
+<ul>
+<li> Updated version numbers, README, HISTORY.
+</li>
+</ul>
+
+<p>  Version 0.5.2a3, 2006-03-13
+</p>
+<ul>
+<li> Gnumeric writes user-defined formats with format codes starting at
+     50 instead of 164; worked around.
+</li>
+<li> Thanks to Didrik Pinte for reporting the need for xlrd to be more tolerant
+     of the idiosyncracies of other software, for supplying sample files,
+     and for performing alpha testing.
+</li>
+<li> '_' character in a format should be treated like an escape character; fixed.
+</li>
+<li> An "empty" formula result means a zero-length string, not an empty cell! Fixed.
+</li>
+</ul>
+
+<p>  Version 0.5.2a2, 2006-03-09
+</p>
+<ul>
+<li> Found that Gnumeric writes all DIMENSIONS records with nrows and ncols
+     each 1 less than they should be (except when it clamps ncols at 256!),
+     and pyXLwriter doesn't write ROW records. Cell memory pre-allocation was
+     generalised to use ROW records if available with fall-back to DIMENSIONS records.
+</li>
+</ul>
+
+<p>  Version 0.5.2a1, 2006-03-06
+</p>
+<ul>
+<li> pyXLwriter writes DIMENSIONS record with antique opcode 0x0000
+     instead of 0x0200; worked around
+</li>
+<li> A file written by Gnumeric had zeroes in DIMENSIONS record
+     but data in cell A1; worked around
+</li>
+</ul>
+
+<p>  Version 0.5.1, 2006-02-18, released to Journyx
+</p>
+<ul>
+<li> Python 2.1 mmap requires file to be opened for update access.
+     Added fall-back to read-only access without mmap if 2.1 open fails
+     because "permission denied".
+</li>
+</ul>
+
+<p>  Version 0.5, 2006-02-07, released to Journyx
+</p>
+<ul>
+<li> Now works with Python 2.1. Backporting to Python 2.1 was partially
+     funded by Journyx - provider of timesheet and project accounting
+     solutions (http://journyx.com/)
+</li>
+<li> open_workbook() can be given the contents of a file
+     instead of its name. Thanks to Remco Boerma for the suggestion.
+</li>
+<li> New module attribute __VERSION__ (as a string; for example "0.5")
+</li>
+<li> Minor enhancements to classification of formats as date or not-date.
+</li>
+<li> Added warnings about files with inconsistent OLE compound document
+     structures. Thanks to Roman V. Kiseliov (author of pyExcelerator)
+     for the tip-off.
+</li>
+</ul>
+
+<p>  Version 0.4a1, 2005-09-07, released to Laurent T.
+</p>
+<ul>
+<li> Book and sheet objects can now be pickled and unpickled.
+     Instead of reading a large spreadsheet multiple times,
+     consider pickling it once and loading the saved pickle;
+     can be much faster. Thanks to Laurent Thioudellet for the
+     enhancement request.
+</li>
+<li> Using the mmap module can be turned off.
+     But you would only do that for benchmarking purposes.
+</li>
+<li> Handling NUMBER records has been made faster
+</li>
+</ul>
+
+<p>  Version 0.3a1, 2005-05-15, first public release
+</p>
+
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..fa919f4
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,2 @@
+include README.html
+recursive-include tests *.py *.xls *.xlsx
diff --git a/PKG-INFO b/PKG-INFO
index f4099f6..345f3b4 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: xlrd
-Version: 0.9.4
+Version: 1.0.0
 Summary: Library for developers to extract data from Microsoft Excel (tm) spreadsheet files
 Home-page: http://www.python-excel.org/
 Author: John Machin
diff --git a/README.html b/README.html
deleted file mode 100644
index bbc3675..0000000
--- a/README.html
+++ /dev/null
@@ -1,135 +0,0 @@
-<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
-<title>The xlrd Module -- README</title>
-</head>
-<body>
-
-<h3>Python package "xlrd"</h3>
-
-<p><b>Purpose</b>: Provide a library for developers to use to extract data
-    from Microsoft Excel (tm) spreadsheet files.
-    It is not an end-user tool.
-</p>
-<p><b>Author</b>: John Machin, Lingfo Pty Ltd (sjmachin at lexicon.net)
-</p>
-<p><b>Licence</b>: BSD-style (see licences.py)
-</p>
-<p><b>Version of xlrd</b>: 0.7.1 -- 2009-05-31
-</p>
-<p><b>Versions of Python supported</b>: 2.6-2.7.
-</p>
-<p><b>External modules required</b>:
-</p>
-<dl><dd> The package itself is pure Python with no dependencies on modules or packages
-    outside the standard Python distribution.
-</dd>
-</dl>
-<p><b>Versions of Excel supported</b>:
-    2004, 2003, XP, 2000, 97, 95, 5.0, 4.0, 3.0, 2.1, 2.0.
-    Support for Excel 2007 .xlsx files scheduled for version 0.7.1.
-</p>
-<p><b>Outside the current scope</b>: xlrd will safely and reliably ignore any of these
-if present in the file:
-</p>
-<ul>
-<li> Charts, Macros, Pictures, any other embedded object. WARNING: currently
-      this includes embedded worksheets.
-</li>
-<li> VBA modules
-</li>
-<li> Formulas (results of formula calculations are extracted, of course).
-</li>
-<li> Comments
-</li>
-<li> Hyperlinks
-</li>
-<li> Autofilters, advanced filters, pivot tables, conditional formatting, data validation
-</li>
-</ul>
-<p><b>Unlikely to be done</b>:
-</p>
-<ul><li> Handling password-protected (encrypted) files.
-</li>
-</ul>
-<p><b>Particular emphasis (refer docs for details)</b>:
-</p>
-<ul><li> Operability across OS, regions, platforms
-</li>
-<li> Handling Excel's date problems, including the Windows / Macintosh
-      four-year differential.
-</li>
-<li> Providing access to named constants and named groups of cells (from version 0.6.0)
-</li>
-<li> Providing access to "visual" information: font, "number format", background, border,
-     alignment and protection for cells, height/width etc for rows/columns (from version 0.6.1)
-</li>
-</ul>
-<p><b>Quick start</b>:
-</p>
-<pre><code>    import xlrd
-    book = xlrd.open_workbook("myfile.xls")
-    print "The number of worksheets is", book.nsheets
-    print "Worksheet name(s):", book.sheet_names()
-    sh = book.sheet_by_index(0)
-    print sh.name, sh.nrows, sh.ncols
-    print "Cell D30 is", sh.cell_value(rowx=29, colx=3)
-    for rx in range(sh.nrows):
-        print sh.row(rx)
-    # Refer to docs for more details.
-    # Feedback on API is welcomed.
-</code></pre><p>
-</p>
-<p><b>Another quick start</b>: This will show the first, second and last rows of each
-    sheet in each file:
-</p>
-
-<pre><code>    OS-prompt>python PYDIR/scripts/runxlrd.py 3rows *blah*.xls</code></pre>
-
-<p><b>Installation</b>:
-</p>
-<ul><li> On Windows: use the installer.
-</li>
-<li> Any OS: Unzip the .zip file into a suitable directory,
-    chdir to that directory, then do "python setup.py install".
-</li>
-<li> If PYDIR is your Python installation directory:
-    the main files are in PYDIR/Lib/site-packages/xlrd
-    the docs are in the doc subdirectory,
-    and there's a sample script: PYDIR/Scripts/runxlrd.py
-</li>
-<li> If os.sep != "/": make the appropriate adjustments.
-</li>
-</ul>
-<p><b>Download URLs</b>:
-</p>
-<ul><li> http://pypi.python.org/pypi/xlrd
-</li>
-<li> http://www.lexicon.net/sjmachin/xlrd.htm
-</li>
-</ul>
-<p><b>Acknowledgements</b>:
-</p>
-<ul><li> This package started life as a translation from C into Python
-of parts of a utility called "xlreader" developed by David Giffin.
-"This product includes software developed by David Giffin <david at giffin.org>."
-</li>
-<li> OpenOffice.org has truly excellent documentation of the Microsoft Excel file formats
-and Compound Document file format, authored by Daniel Rentz. See http://sc.openoffice.org
-</li>
-<li> U+5F20 U+654F: over a decade of inspiration, support, and interesting decoding opportunities.
-</li>
-<li> Ksenia Marasanova: sample Macintosh and non-Latin1 files, alpha testing
-</li>
-<li> Backporting to Python 2.1 was partially funded by Journyx - provider of
-timesheet and project accounting solutions (http://journyx.com/).
-</li>
-<li> Provision of formatting information in version 0.6.1 was funded by Simplistix Ltd
-   (http://www.simplistix.co.uk/)
-</li>
-<li> << a growing list of names; see HISTORY.html >>: feedback, testing, test files, ...
-</li></ul>
-
-</body>
-</html>
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..71d8eae
--- /dev/null
+++ b/README.md
@@ -0,0 +1,82 @@
+### Python package "xlrd"
+
+**Purpose**: Provide a library for developers to use to extract data from Microsoft Excel (tm) spreadsheet files. It is not an end-user tool.
+
+**Author**: John Machin, Lingfo Pty Ltd (sjmachin at lexicon.net)
+
+**Licence**: BSD-style (see licences.py)
+
+**Versions of Python supported**: 2.6, 2.7, 3.2+.
+
+**External modules required**:
+
+<dl>
+
+<dd>The package itself is pure Python with no dependencies on modules or packages outside the standard Python distribution.</dd>
+
+</dl>
+
+**Outside the current scope**: xlrd will safely and reliably ignore any of these if present in the file:
+
+*   Charts, Macros, Pictures, any other embedded object. WARNING: currently this includes embedded worksheets.
+*   VBA modules
+*   Formulas (results of formula calculations are extracted, of course).
+*   Comments
+*   Hyperlinks
+*   Autofilters, advanced filters, pivot tables, conditional formatting, data validation
+
+**Unlikely to be done**:
+
+*   Handling password-protected (encrypted) files.
+
+**Particular emphasis (refer docs for details)**:
+
+*   Operability across OS, regions, platforms
+*   Handling Excel's date problems, including the Windows / Macintosh four-year differential.
+*   Providing access to named constants and named groups of cells (from version 0.6.0)
+*   Providing access to "visual" information: font, "number format", background, border, alignment and protection for cells, height/width etc for rows/columns (from version 0.6.1)
+
+**Quick start**:
+
+```
+    import xlrd
+    book = xlrd.open_workbook("myfile.xls")
+    print "The number of worksheets is", book.nsheets
+    print "Worksheet name(s):", book.sheet_names()
+    sh = book.sheet_by_index(0)
+    print sh.name, sh.nrows, sh.ncols
+    print "Cell D30 is", sh.cell_value(rowx=29, colx=3)
+    for rx in range(sh.nrows):
+        print sh.row(rx)
+    # Refer to docs for more details.
+    # Feedback on API is welcomed.
+
+```
+
+**Another quick start**: This will show the first, second and last rows of each sheet in each file:
+
+```
+    OS-prompt>python PYDIR/scripts/runxlrd.py 3rows *blah*.xls
+```
+
+**Installation**:
+
+*   On Windows: use the installer.
+*   Any OS: Unzip the .zip file into a suitable directory, chdir to that directory, then do "python setup.py install".
+*   If PYDIR is your Python installation directory: the main files are in PYDIR/Lib/site-packages/xlrd the docs are in the doc subdirectory, and there's a sample script: PYDIR/Scripts/runxlrd.py
+*   If os.sep != "/": make the appropriate adjustments.
+
+**Download URLs**:
+
+*   http://pypi.python.org/pypi/xlrd
+*   http://www.lexicon.net/sjmachin/xlrd.htm
+
+**Acknowledgements**:
+
+*   This package started life as a translation from C into Python of parts of a utility called "xlreader" developed by David Giffin. "This product includes software developed by David Giffin <david at giffin.org>."
+*   OpenOffice.org has truly excellent documentation of the Microsoft Excel file formats and Compound Document file format, authored by Daniel Rentz. See http://sc.openoffice.org
+*   U+5F20 U+654F: over a decade of inspiration, support, and interesting decoding opportunities.
+*   Ksenia Marasanova: sample Macintosh and non-Latin1 files, alpha testing
+*   Backporting to Python 2.1 was partially funded by Journyx - provider of timesheet and project accounting solutions (http://journyx.com/).
+*   Provision of formatting information in version 0.6.1 was funded by Simplistix Ltd (http://www.simplistix.co.uk/)
+*   << a growing list of names; see HISTORY.html >>: feedback, testing, test files, ...
diff --git a/build.txt b/build.txt
new file mode 100644
index 0000000..d6fae8f
--- /dev/null
+++ b/build.txt
@@ -0,0 +1,12 @@
+Instructions to build releases
+------------------------------
+
+- Make sure you run tests
+
+~/virtualenvs/tox/bin/tox -e py26,py27,py32,py33
+
+- Change the version in xlrd.info.__VERSION__
+
+- Create tag.
+
+- Push to Travis.
diff --git a/make_doc.bat b/make_doc.bat
new file mode 100644
index 0000000..357b26a
--- /dev/null
+++ b/make_doc.bat
@@ -0,0 +1,6 @@
+c:\python25\python pkg_doc.py xlrd
+c:\python25\python pythondoc.py xlrd/compdoc.py
+del compdoc.html
+rename pythondoc-compdoc.html compdoc.html
+copy xlrd.html xlrd\doc
+copy compdoc.html xlrd\doc
diff --git a/pkg_doc.py b/pkg_doc.py
new file mode 100644
index 0000000..3e00b41
--- /dev/null
+++ b/pkg_doc.py
@@ -0,0 +1,31 @@
+from pythondoc import ET, parse, CompactHTML
+import sys
+
+MODULE_NAME = "xlrd"
+PATH_TO_FILES = sys.argv[1]
+
+
+module = ET.Element("module", name=MODULE_NAME)
+
+parts = [
+    '__init__',
+    'sheet',
+    'xldate',
+    # 'compdoc',
+    'biffh',
+    'formatting',
+    'formula',
+    ]
+flist = ["%s/%s.py" % (PATH_TO_FILES, p) for p in parts]
+for fname in flist:
+    print "about to parse", fname
+    elem = parse(fname)
+    for elem in elem:
+        if module and elem.tag == "info":
+            # skip all module info sections except the first
+            continue
+        module.append(elem)
+
+formatter = CompactHTML()
+print formatter.save(module, MODULE_NAME), "ok"
+
diff --git a/pythondoc.py b/pythondoc.py
new file mode 100644
index 0000000..b99f66a
--- /dev/null
+++ b/pythondoc.py
@@ -0,0 +1,1428 @@
+#
+#!/usr/bin/env python
+#
+# $Id: pythondoc.py 3271 2007-09-09 09:45:14Z fredrik $
+# pythondoc documentation generator
+#
+# history:
+# 2003-10-19 fl   first preview release (2.0a1)
+# 2003-10-19 fl   fix HTML in descriptor tags, 1.5.2 tweaks, etc (2.0a2)
+# 2003-10-20 fl   added encoding support, default HTML generator, etc (2.0a3)
+# 2003-10-21 fl   fixed some 1.5.2 issues, etc (2.0b1)
+# 2003-10-22 fl   HTML tweaks, pluggable output generators, etc (2.0b2)
+# 2003-10-23 fl   fixed encoding, added @author, @version, @since etc
+# 2003-10-24 fl   disable XML output by default
+# 2003-10-25 fl   moved info properties into an 'info' element
+# 2003-10-26 fl   expand wildcards on windows (2.0b3)
+# 2003-10-30 fl   added support for RISC OS
+# 2003-10-31 fl   (experimental) support module-level comments
+# 2003-11-01 fl   minor HTML tweaks (2.0b4)
+# 2003-11-03 fl   pythondoc 2.0 final
+# 2003-11-15 fl   added support for inline @link/@linkplain tags (2.1b1)
+# 2003-11-20 fl   fixed class attribute parsing bug
+# 2004-03-27 fl   handle multiple single-line methods
+# 2004-09-01 fl   support Python 2.4 decorators (2.1b2)
+# 2004-09-21 fl   fixed output filename for "pythondoc ."
+# 2005-03-25 fl   added docstring extraction for classes and methods (2.1b3)
+# 2005-06-18 fl   fixed correct HTML output when using ElementTree 1.3 (2.1b4)
+# 2005-12-23 fl   use xml.etree where available
+# 2006-04-04 fl   refactored comment parser code; added -s support (2.1b5)
+# 2006-04-06 fl   handle multiple params in docstrings correctly (2.1b6)
+# 2007-09-09 fl   moved HTML parser into pythondoc module itself
+#
+# Copyright (c) 2002-2007 by Fredrik Lundh.
+#
+
+##
+# This is the PythonDoc tool.  This tool parses Python source files
+# and generates API descriptions in XML and HTML.
+# <p>
+# For more information on the PythonDoc tool and the markup format, see
+# <a href="http://effbot.org/zone/pythondoc.htm">the PythonDoc page</a>
+# at <a href="http://effbot.org/">effbot.org</a>.
+##
+
+# --------------------------------------------------------------------
+# Software License
+# --------------------------------------------------------------------
+#
+# Copyright (c) 2002-2007 by Fredrik Lundh
+#
+# By obtaining, using, and/or copying this software and/or its
+# associated documentation, you agree that you have read, understood,
+# and will comply with the following terms and conditions:
+#
+# Permission to use, copy, modify, and distribute this software and
+# its associated documentation for any purpose and without fee is
+# hereby granted, provided that the above copyright notice appears in
+# all copies, and that both that copyright notice and this permission
+# notice appear in supporting documentation, and that the name of
+# Secret Labs AB or the author not be used in advertising or publicity
+# pertaining to distribution of the software without specific, written
+# prior permission.
+#
+# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
+# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
+# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
+# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+#
+# --------------------------------------------------------------------
+
+# to do in later releases:
+#
+# TODO: test this release under 1.5.2 !
+# TODO: better rendering of constructors/package modules
+# TODO: check @param names against @def/define tags
+# TODO: support recursive parsing (-R)
+# TODO: warn for tags that doesn't make sense for a given target type
+# TODO: HTML output localization (the %s module, returns, raises, etc)
+# TODO: make compactHTML generate an element tree instead of raw HTML
+#
+# nice to have, maybe:
+#
+# IDEA: support multiple output handlers (multiple -O statements);
+#       make -x an alias for -Oxml
+# IDEA: make pythondoc self-contained (include stub element implementation)
+
+VERSION_DATE = "2.1b7-20070909"
+VERSION = VERSION_DATE.split("-")[0]
+
+COPYRIGHT = "(c) 2002-2007 by Fredrik Lundh"
+
+# explicitly import site (for exemaker etc)
+import site
+
+# stuff we use in this module
+import glob, os, re, string, sys, tokenize
+
+# make sure elementtree is available
+try:
+    try:
+        import xml.etree.ElementTree as ET
+    except ImportError:
+        import elementtree.ElementTree as ET
+except ImportError:
+    raise RuntimeError(
+        "PythonDoc %s requires ElementTree 1.1 or later "
+        "(available from http://effbot.org/downloads)." % VERSION
+        )
+
+# extension separator (not all systems use a period)
+try:
+    EXTSEP = os.extsep
+except AttributeError:
+    EXTSEP = "."
+
+##
+# Debug level.  The higher the value, the more junk you'll see on
+# standard output.
+# <p>
+# You can use the <b>-V</b> option to <b>pythondoc</b> to increase
+# the debug level.
+
+DEBUG = 0
+
+##
+# Whitespace tokens.  These are ignored when the parser is scanning
+# for a subject.
+
+WHITESPACE_TOKEN = (
+    tokenize.NL, tokenize.NEWLINE, tokenize.DEDENT, tokenize.INDENT
+    )
+
+##
+# Default encoding.  To override this for a module, put a "coding"
+# directive in your Python module (see PEP 263 for details).
+
+ENCODING = "iso-8859-1"
+
+##
+# Known tags.  The parser generates warnings for tags that are not in
+# this list, but it still copies them to the XML infoset.
+
+TAGS = (
+    "def", "defreturn",
+    "param", "keyparam",
+    "return",
+    "throws", "exception",
+    # javadoc tags not used by the standard generator
+    "author", "deprecated", "see", "since", "version"
+    )
+
+##
+# (Helper) Combines filename prefix with extension part.
+#
+# @param prefix Filename prefix.
+# @param ext Extension string, including a leading period.  The
+#    period is replaced with a platform-specific separator, if
+#    necessary.
+# @return The combined name.
+
+def joinext(prefix, ext):
+    assert ext[0] == "." # require leading separator, to match os.path.splitext
+    return prefix + EXTSEP + ext[1:]
+
+##
+# (Helper) Extracts block tags from a PythonDoc comment.
+#
+# @param comment Comment text.
+# @return A list of (lineno, tag, text) tuples, where the tag is None
+#     for the initial description.
+# @defreturn List of tuples.
+
+def gettags(comment):
+
+    tags = []
+
+    tag = None
+    tag_lineno = lineno = 0
+    tag_text = []
+
+    for line in comment:
+        if line[:1] == "@":
+            tags.append((tag_lineno, tag, string.join(tag_text, "\n")))
+            line = string.split(line, " ", 1)
+            tag = line[0][1:]
+            if len(line) > 1:
+                tag_text = [line[1]]
+            else:
+                tag_text = []
+            tag_lineno = lineno
+        else:
+            tag_text.append(line)
+        lineno = lineno + 1
+
+    tags.append((tag_lineno, tag, string.join(tag_text, "\n")))
+
+    return tags
+
+##
+# (Helper) Flattens an element tree, returning only the text contents.
+#
+# @param elem An element tree.
+# @return A text string.
+# @defreturn String.
+
+def flatten(elem):
+    text = elem.text or ""
+    for e in elem:
+        text += flatten(e)
+        if e.tail:
+            text += e.tail
+    return text
+
+##
+# (Helper) Extracts summary from a PythonDoc comment.  This function
+# gets the first complete sentence from the description string.
+#
+# @param description An element containing the description.
+# @return A summary string.
+# @defreturn String.
+
+def getsummary(description):
+
+    description = flatten(description)
+
+    # extract the first sentence from the description
... 1996 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-xlrd.git



More information about the Python-modules-commits mailing list