xlrd.html 101 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064
  1. <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
  2. <html>
  3. <head>
  4. <meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
  5. <title>The xlrd Module</title>
  6. </head>
  7. <body>
  8. <h1>The xlrd Module</h1>
  9. <p /><p><b>A Python module for extracting data from MS Excel (TM) spreadsheet files.
  10. <br /><br />
  11. Version 0.7.4 -- April 2012
  12. </b></p>
  13. <h2>General information</h2>
  14. <h3>Acknowledgements</h3>
  15. <p>
  16. Development of this module would not have been possible without the document
  17. "OpenOffice.org's Documentation of the Microsoft Excel File Format"
  18. ("OOo docs" for short).
  19. The latest version is available from OpenOffice.org in
  20. <a href="http://sc.openoffice.org/excelfileformat.pdf"> PDF format</a>
  21. and
  22. <a href="http://sc.openoffice.org/excelfileformat.odt"> ODT format.</a>
  23. Small portions of the OOo docs are reproduced in this
  24. document. A study of the OOo docs is recommended for those who wish a
  25. deeper understanding of the Excel file layout than the xlrd docs can provide.
  26. </p>
  27. <p>Backporting to Python 2.1 was partially funded by
  28. <a href="http://journyx.com/">
  29. Journyx - provider of timesheet and project accounting solutions.
  30. </a>
  31. </p>
  32. <p>Provision of formatting information in version 0.6.1 was funded by
  33. <a href="http://www.simplistix.co.uk">
  34. Simplistix Ltd.
  35. </a>
  36. </p>
  37. <h3>Unicode</h3>
  38. <p>This module presents all text strings as Python unicode objects.
  39. From Excel 97 onwards, text in Excel spreadsheets has been stored as Unicode.
  40. Older files (Excel 95 and earlier) don't keep strings in Unicode;
  41. a CODEPAGE record provides a codepage number (for example, 1252) which is
  42. used by xlrd to derive the encoding (for same example: "cp1252") which is
  43. used to translate to Unicode.</p>
  44. <small>
  45. <p>If the CODEPAGE record is missing (possible if the file was created
  46. by third-party software), xlrd will assume that the encoding is ascii, and keep going.
  47. If the actual encoding is not ascii, a UnicodeDecodeError exception will be raised and
  48. you will need to determine the encoding yourself, and tell xlrd:
  49. <pre>
  50. book = xlrd.open_workbook(..., encoding_override="cp1252")
  51. </pre></p>
  52. <p>If the CODEPAGE record exists but is wrong (for example, the codepage
  53. number is 1251, but the strings are actually encoded in koi8_r),
  54. it can be overridden using the same mechanism.
  55. The supplied runxlrd.py has a corresponding command-line argument, which
  56. may be used for experimentation:
  57. <pre>
  58. runxlrd.py -e koi8_r 3rows myfile.xls
  59. </pre></p>
  60. <p>The first place to look for an encoding ("codec name") is
  61. <a href="http://docs.python.org/lib/standard-encodings.html">
  62. the Python documentation</a>.
  63. </p>
  64. </small>
  65. <h3>Dates in Excel spreadsheets</h3>
  66. <p>In reality, there are no such things. What you have are floating point
  67. numbers and pious hope.
  68. There are several problems with Excel dates:</p>
  69. <p>(1) Dates are not stored as a separate data type; they are stored as
  70. floating point numbers and you have to rely on
  71. (a) the "number format" applied to them in Excel and/or
  72. (b) knowing which cells are supposed to have dates in them.
  73. This module helps with (a) by inspecting the
  74. format that has been applied to each number cell;
  75. if it appears to be a date format, the cell
  76. is classified as a date rather than a number. Feedback on this feature,
  77. especially from non-English-speaking locales, would be appreciated.</p>
  78. <p>(2) Excel for Windows stores dates by default as the number of
  79. days (or fraction thereof) since 1899-12-31T00:00:00. Excel for
  80. Macintosh uses a default start date of 1904-01-01T00:00:00. The date
  81. system can be changed in Excel on a per-workbook basis (for example:
  82. Tools -&gt; Options -&gt; Calculation, tick the "1904 date system" box).
  83. This is of course a bad idea if there are already dates in the
  84. workbook. There is no good reason to change it even if there are no
  85. dates in the workbook. Which date system is in use is recorded in the
  86. workbook. A workbook transported from Windows to Macintosh (or vice
  87. versa) will work correctly with the host Excel. When using this
  88. module's xldate_as_tuple function to convert numbers from a workbook,
  89. you must use the datemode attribute of the Book object. If you guess,
  90. or make a judgement depending on where you believe the workbook was
  91. created, you run the risk of being 1462 days out of kilter.</p>
  92. <p>Reference:
  93. http://support.microsoft.com/default.aspx?scid=KB;EN-US;q180162</p>
  94. <p>(3) The Excel implementation of the Windows-default 1900-based date system works on the
  95. incorrect premise that 1900 was a leap year. It interprets the number 60 as meaning 1900-02-29,
  96. which is not a valid date. Consequently any number less than 61 is ambiguous. Example: is 59 the
  97. result of 1900-02-28 entered directly, or is it 1900-03-01 minus 2 days? The OpenOffice.org Calc
  98. program "corrects" the Microsoft problem; entering 1900-02-27 causes the number 59 to be stored.
  99. Save as an XLS file, then open the file with Excel -- you'll see 1900-02-28 displayed.</p>
  100. <p>Reference: http://support.microsoft.com/default.aspx?scid=kb;en-us;214326</p>
  101. <p>(4) The Macintosh-default 1904-based date system counts 1904-01-02 as day 1 and 1904-01-01 as day zero.
  102. Thus any number such that (0.0 &lt;= number &lt; 1.0) is ambiguous. Is 0.625 a time of day (15:00:00),
  103. independent of the calendar,
  104. or should it be interpreted as an instant on a particular day (1904-01-01T15:00:00)?
  105. The xldate_* functions in this module
  106. take the view that such a number is a calendar-independent time of day (like Python's datetime.time type) for both
  107. date systems. This is consistent with more recent Microsoft documentation
  108. (for example, the help file for Excel 2002 which says that the first day
  109. in the 1904 date system is 1904-01-02).
  110. </p><p>(5) Usage of the Excel DATE() function may leave strange dates in a spreadsheet. Quoting the help file,
  111. in respect of the 1900 date system: "If year is between 0 (zero) and 1899 (inclusive),
  112. Excel adds that value to 1900 to calculate the year. For example, DATE(108,1,2) returns January 2, 2008 (1900+108)."
  113. This gimmick, semi-defensible only for arguments up to 99 and only in the pre-Y2K-awareness era,
  114. means that DATE(1899, 12, 31) is interpreted as 3799-12-31.</p>
  115. <p>For further information, please refer to the documentation for the xldate_* functions.</p>
  116. <h3> Named references, constants, formulas, and macros</h3>
  117. <p>
  118. A name is used to refer to a cell, a group of cells, a constant
  119. value, a formula, or a macro. Usually the scope of a name is global
  120. across the whole workbook. However it can be local to a worksheet.
  121. For example, if the sales figures are in different cells in
  122. different sheets, the user may define the name "Sales" in each
  123. sheet. There are built-in names, like "Print_Area" and
  124. "Print_Titles"; these two are naturally local to a sheet.
  125. </p><p>
  126. To inspect the names with a user interface like MS Excel, OOo Calc,
  127. or Gnumeric, click on Insert/Names/Define. This will show the global
  128. names, plus those local to the currently selected sheet.
  129. </p><p>
  130. A Book object provides two dictionaries (name_map and
  131. name_and_scope_map) and a list (name_obj_list) which allow various
  132. ways of accessing the Name objects. There is one Name object for
  133. each NAME record found in the workbook. Name objects have many
  134. attributes, several of which are relevant only when obj.macro is 1.
  135. </p><p>
  136. In the examples directory you will find namesdemo.xls which
  137. showcases the many different ways that names can be used, and
  138. xlrdnamesAPIdemo.py which offers 3 different queries for inspecting
  139. the names in your files, and shows how to extract whatever a name is
  140. referring to. There is currently one "convenience method",
  141. Name.cell(), which extracts the value in the case where the name
  142. refers to a single cell. More convenience methods are planned. The
  143. source code for Name.cell (in __init__.py) is an extra source of
  144. information on how the Name attributes hang together.
  145. </p>
  146. <p><i>Name information is <b>not</b> extracted from files older than
  147. Excel 5.0 (Book.biff_version &lt; 50)</i></p>
  148. <h3>Formatting</h3>
  149. <h4>Introduction</h4>
  150. <p>This collection of features, new in xlrd version 0.6.1, is intended
  151. to provide the information needed to (1) display/render spreadsheet contents
  152. (say) on a screen or in a PDF file, and (2) copy spreadsheet data to another
  153. file without losing the ability to display/render it.</p>
  154. <h4>The Palette; Colour Indexes</h4>
  155. <p>A colour is represented in Excel as a (red, green, blue) ("RGB") tuple
  156. with each component in range(256). However it is not possible to access an
  157. unlimited number of colours; each spreadsheet is limited to a palette of 64 different
  158. colours (24 in Excel 3.0 and 4.0, 8 in Excel 2.0). Colours are referenced by an index
  159. ("colour index") into this palette.
  160. Colour indexes 0 to 7 represent 8 fixed built-in colours: black, white, red, green, blue,
  161. yellow, magenta, and cyan.</p><p>
  162. The remaining colours in the palette (8 to 63 in Excel 5.0 and later)
  163. can be changed by the user. In the Excel 2003 UI, Tools/Options/Color presents a palette
  164. of 7 rows of 8 colours. The last two rows are reserved for use in charts.<br />
  165. The correspondence between this grid and the assigned
  166. colour indexes is NOT left-to-right top-to-bottom.<br />
  167. Indexes 8 to 15 correspond to changeable
  168. parallels of the 8 fixed colours -- for example, index 7 is forever cyan;
  169. index 15 starts off being cyan but can be changed by the user.<br />
  170. The default colour for each index depends on the file version; tables of the defaults
  171. are available in the source code. If the user changes one or more colours,
  172. a PALETTE record appears in the XLS file -- it gives the RGB values for *all* changeable
  173. indexes.<br />
  174. Note that colours can be used in "number formats": "[CYAN]...." and "[COLOR8]...." refer
  175. to colour index 7; "[COLOR16]...." will produce cyan
  176. unless the user changes colour index 15 to something else.<br />
  177. </p><p>In addition, there are several "magic" colour indexes used by Excel:<br />
  178. 0x18 (BIFF3-BIFF4), 0x40 (BIFF5-BIFF8): System window text colour for border lines
  179. (used in XF, CF, and WINDOW2 records)<br />
  180. 0x19 (BIFF3-BIFF4), 0x41 (BIFF5-BIFF8): System window background colour for pattern background
  181. (used in XF and CF records )<br />
  182. 0x43: System face colour (dialogue background colour)<br />
  183. 0x4D: System window text colour for chart border lines<br />
  184. 0x4E: System window background colour for chart areas<br />
  185. 0x4F: Automatic colour for chart border lines (seems to be always Black)<br />
  186. 0x50: System ToolTip background colour (used in note objects)<br />
  187. 0x51: System ToolTip text colour (used in note objects)<br />
  188. 0x7FFF: System window text colour for fonts (used in FONT and CF records)<br />
  189. Note 0x7FFF appears to be the *default* colour index. It appears quite often in FONT
  190. records.<br />
  191. <h4>Default Formatting</h4>
  192. Default formatting is applied to all empty cells (those not described by a cell record).
  193. Firstly row default information (ROW record, Rowinfo class) is used if available.
  194. Failing that, column default information (COLINFO record, Colinfo class) is used if available.
  195. As a last resort the worksheet/workbook default cell format will be used; this
  196. should always be present in an Excel file,
  197. described by the XF record with the fixed index 15 (0-based). By default, it uses the
  198. worksheet/workbook default cell style, described by the very first XF record (index 0).
  199. <h4> Formatting features not included in xlrd version 0.6.1</h4>
  200. <ul>
  201. <li>Rich text i.e. strings containing partial <b>bold</b> <i>italic</i>
  202. and <u>underlined</u> text, change of font inside a string, etc.
  203. See OOo docs s3.4 and s3.2.
  204. <i> Rich text is included in version 0.7.2</i></li>
  205. <li>Asian phonetic text (known as "ruby"), used for Japanese furigana. See OOo docs
  206. s3.4.2 (p15)</li>
  207. <li>Conditional formatting. See OOo docs
  208. s5.12, s6.21 (CONDFMT record), s6.16 (CF record)</li>
  209. <li>Miscellaneous sheet-level and book-level items e.g. printing layout, screen panes. </li>
  210. <li>Modern Excel file versions don't keep most of the built-in
  211. "number formats" in the file; Excel loads formats according to the
  212. user's locale. Currently xlrd's emulation of this is limited to
  213. a hard-wired table that applies to the US English locale. This may mean
  214. that currency symbols, date order, thousands separator, decimals separator, etc
  215. are inappropriate. Note that this does not affect users who are copying XLS
  216. files, only those who are visually rendering cells.</li>
  217. </ul>
  218. <h3>Loading worksheets on demand</h3>
  219. </p><p>This feature, new in version 0.7.1, is governed by the on_demand argument
  220. to the open_workbook() function and allows saving memory and time by loading
  221. only those sheets that the caller is interested in, and releasing sheets
  222. when no longer required.</p>
  223. <p>on_demand=False (default): No change. open_workbook() loads global data
  224. and all sheets, releases resources no longer required (principally the
  225. str or mmap object containing the Workbook stream), and returns.</p>
  226. <p>on_demand=True and BIFF version &lt; 5.0: A warning message is emitted,
  227. on_demand is recorded as False, and the old process is followed.</p>
  228. <p>on_demand=True and BIFF version &gt;= 5.0: open_workbook() loads global
  229. data and returns without releasing resources. At this stage, the only
  230. information available about sheets is Book.nsheets and Book.sheet_names().</p>
  231. <p>Book.sheet_by_name() and Book.sheet_by_index() will load the requested
  232. sheet if it is not already loaded.</p>
  233. <p>Book.sheets() will load all/any unloaded sheets.</p>
  234. <p>The caller may save memory by calling
  235. Book.unload_sheet(sheet_name_or_index) when finished with the sheet.
  236. This applies irrespective of the state of on_demand.</p>
  237. <p>The caller may re-load an unloaded sheet by calling Book.sheet_by_xxxx()
  238. -- except if those required resources have been released (which will
  239. have happened automatically when on_demand is false). This is the only
  240. case where an exception will be raised.</p>
  241. <p>The caller may query the state of a sheet:
  242. Book.sheet_loaded(sheet_name_or_index) -&gt; a bool</p>
  243. <p> Book.release_resources() may used to save memory and close
  244. any memory-mapped file before proceding to examine already-loaded
  245. sheets. Once resources are released, no further sheets can be loaded.</p>
  246. <p> When using on-demand, it is advisable to ensure that
  247. Book.release_resources() is always called even if an exception
  248. is raised in your own code; otherwise if the input file has been
  249. memory-mapped, the mmap.mmap object will not be closed and you will
  250. not be able to access the physical file until your Python process
  251. terminates. This can be done by calling Book.release_resources()
  252. explicitly in the finally suite of a try/finally block.
  253. New in xlrd 0.7.2: the Book object is a "context manager", so if
  254. using Python 2.5 or later, you can wrap your code in a "with"
  255. statement.</p>
  256. <h2>Module Contents</h2>
  257. <dl>
  258. <dt><b>BaseObject</b> (class) [<a href='#biffh.BaseObject-class'>#</a>]</dt>
  259. <dd>
  260. <p>Parent of almost all other classes in the package.</p>
  261. <p>For more information about this class, see <a href='#biffh.BaseObject-class'><i>The BaseObject Class</i></a>.</p>
  262. </dd>
  263. <dt><b>Book()</b> (class) [<a href='#__init__.Book-class'>#</a>]</dt>
  264. <dd>
  265. <p>Contents of a &quot;workbook&quot;.</p>
  266. <p>For more information about this class, see <a href='#__init__.Book-class'><i>The Book Class</i></a>.</p>
  267. </dd>
  268. <dt><b>Cell(ctype, value, xf_index=None)</b> (class) [<a href='#sheet.Cell-class'>#</a>]</dt>
  269. <dd>
  270. <p>Contains the data for one cell.</p>
  271. <p>For more information about this class, see <a href='#sheet.Cell-class'><i>The Cell Class</i></a>.</p>
  272. </dd>
  273. <dt><a id='formula.cellname-function' name='formula.cellname-function'><b>cellname(rowx, colx)</b></a> [<a href='#formula.cellname-function'>#</a>]</dt>
  274. <dd>
  275. <p>Utility function: (5, 7) =&gt; 'H6'</p>
  276. </dd>
  277. <dt><a id='formula.cellnameabs-function' name='formula.cellnameabs-function'><b>cellnameabs(rowx, colx, r1c1=0)</b></a> [<a href='#formula.cellnameabs-function'>#</a>]</dt>
  278. <dd>
  279. <p>Utility function: (5, 7) =&gt; '$H$6'</p>
  280. </dd>
  281. <dt><b>Colinfo</b> (class) [<a href='#sheet.Colinfo-class'>#</a>]</dt>
  282. <dd>
  283. <p>Width and default formatting information that applies to one or
  284. more columns in a sheet.</p>
  285. <p>For more information about this class, see <a href='#sheet.Colinfo-class'><i>The Colinfo Class</i></a>.</p>
  286. </dd>
  287. <dt><a id='formula.colname-function' name='formula.colname-function'><b>colname(colx)</b></a> [<a href='#formula.colname-function'>#</a>]</dt>
  288. <dd>
  289. <p>Utility function: 7 =&gt; 'H', 27 =&gt; 'AB'</p>
  290. </dd>
  291. <dt><a id='__init__.count_records-function' name='__init__.count_records-function'><b>count_records(filename, outfile=sys.stdout)</b></a> [<a href='#__init__.count_records-function'>#</a>]</dt>
  292. <dd>
  293. <p>For debugging and analysis: summarise the file's BIFF records.
  294. I.e. produce a sorted file of (record_name, count).</p>
  295. <dl>
  296. <dt><i>filename</i></dt>
  297. <dd>
  298. The path to the file to be summarised.</dd>
  299. <dt><i>outfile</i></dt>
  300. <dd>
  301. An open file, to which the summary is written.</dd>
  302. </dl><br />
  303. </dd>
  304. <dt><a id='__init__.dump-function' name='__init__.dump-function'><b>dump(filename, outfile=sys.stdout, unnumbered=False)</b></a> [<a href='#__init__.dump-function'>#</a>]</dt>
  305. <dd>
  306. <p>For debugging: dump the file's BIFF records in char &amp; hex.
  307. </p><dl>
  308. <dt><i>filename</i></dt>
  309. <dd>
  310. The path to the file to be dumped.</dd>
  311. <dt><i>outfile</i></dt>
  312. <dd>
  313. An open file, to which the dump is written.</dd>
  314. <dt><i>unnumbered</i></dt>
  315. <dd>
  316. If true, omit offsets (for meaningful diffs).</dd>
  317. </dl><br />
  318. </dd>
  319. <dt><a id='sheet.empty_cell-variable' name='sheet.empty_cell-variable'><b>empty_cell</b></a> (variable) [<a href='#sheet.empty_cell-variable'>#</a>]</dt>
  320. <dd>
  321. <p>There is one and only one instance of an empty cell -- it's a singleton. This is it.
  322. You may use a test like &quot;acell is empty_cell&quot;.</p>
  323. </dd>
  324. <dt><b>EqNeAttrs</b> (class) [<a href='#formatting.EqNeAttrs-class'>#</a>]</dt>
  325. <dd>
  326. <p>This mixin class exists solely so that Format, Font, and XF....</p>
  327. <p>For more information about this class, see <a href='#formatting.EqNeAttrs-class'><i>The EqNeAttrs Class</i></a>.</p>
  328. </dd>
  329. <dt><a id='biffh.error_text_from_code-variable' name='biffh.error_text_from_code-variable'><b>error_text_from_code</b></a> (variable) [<a href='#biffh.error_text_from_code-variable'>#</a>]</dt>
  330. <dd>
  331. <p /><p>This dictionary can be used to produce a text version of the internal codes
  332. that Excel uses for error cells. Here are its contents:
  333. <pre>
  334. 0x00: '#NULL!', # Intersection of two cell ranges is empty
  335. 0x07: '#DIV/0!', # Division by zero
  336. 0x0F: '#VALUE!', # Wrong type of operand
  337. 0x17: '#REF!', # Illegal or deleted cell reference
  338. 0x1D: '#NAME?', # Wrong function or range name
  339. 0x24: '#NUM!', # Value range overflow
  340. 0x2A: '#N/A', # Argument or function not available
  341. </pre></p>
  342. </dd>
  343. <dt><b>Font</b> (class) [<a href='#formatting.Font-class'>#</a>]</dt>
  344. <dd>
  345. <p>An Excel &quot;font&quot; contains the details of not only what is normally
  346. considered a font, but also several other display attributes.</p>
  347. <p>For more information about this class, see <a href='#formatting.Font-class'><i>The Font Class</i></a>.</p>
  348. </dd>
  349. <dt><b>Format(format_key, ty, format_str)</b> (class) [<a href='#formatting.Format-class'>#</a>]</dt>
  350. <dd>
  351. <p>&quot;Number format&quot; information from a FORMAT record.</p>
  352. <p>For more information about this class, see <a href='#formatting.Format-class'><i>The Format Class</i></a>.</p>
  353. </dd>
  354. <dt><b>Hyperlink</b> (class) [<a href='#sheet.Hyperlink-class'>#</a>]</dt>
  355. <dd>
  356. <p>Contains the attributes of a hyperlink.</p>
  357. <p>For more information about this class, see <a href='#sheet.Hyperlink-class'><i>The Hyperlink Class</i></a>.</p>
  358. </dd>
  359. <dt><b>Name</b> (class) [<a href='#__init__.Name-class'>#</a>]</dt>
  360. <dd>
  361. <p>Information relating to a named reference, formula, macro, etc.</p>
  362. <p>For more information about this class, see <a href='#__init__.Name-class'><i>The Name Class</i></a>.</p>
  363. </dd>
  364. <dt><b>Note</b> (class) [<a href='#sheet.Note-class'>#</a>]</dt>
  365. <dd>
  366. <p> Represents a user &quot;comment&quot; or &quot;note&quot;.</p>
  367. <p>For more information about this class, see <a href='#sheet.Note-class'><i>The Note Class</i></a>.</p>
  368. </dd>
  369. <dt><a id='__init__.open_workbook-function' name='__init__.open_workbook-function'><b>open_workbook(filename=None,
  370. logfile=sys.stdout, verbosity=0, use_mmap=USE_MMAP,
  371. file_contents=None,
  372. encoding_override=None,
  373. formatting_info=False, on_demand=False, ragged_rows=False,
  374. )</b></a> [<a href='#__init__.open_workbook-function'>#</a>]</dt>
  375. <dd>
  376. <p>Open a spreadsheet file for data extraction.</p>
  377. <dl>
  378. <dt><i>filename</i></dt>
  379. <dd>
  380. The path to the spreadsheet file to be opened.</dd>
  381. <dt><i>logfile</i></dt>
  382. <dd>
  383. An open file to which messages and diagnostics are written.</dd>
  384. <dt><i>verbosity</i></dt>
  385. <dd>
  386. Increases the volume of trace material written to the logfile.</dd>
  387. <dt><i>use_mmap</i></dt>
  388. <dd>
  389. Whether to use the mmap module is determined heuristically.
  390. Use this arg to override the result. Current heuristic: mmap is used if it exists.</dd>
  391. <dt><i>file_contents</i></dt>
  392. <dd>
  393. ... as a string or an mmap.mmap object or some other behave-alike object.
  394. If file_contents is supplied, filename will not be used, except (possibly) in messages.</dd>
  395. <dt><i>encoding_override</i></dt>
  396. <dd>
  397. Used to overcome missing or bad codepage information
  398. in older-version files. Refer to discussion in the <b>Unicode</b> section above.
  399. <br /> -- New in version 0.6.0
  400. </dd>
  401. <dt><i>formatting_info</i></dt>
  402. <dd>
  403. Governs provision of a reference to an XF (eXtended Format) object
  404. for each cell in the worksheet.
  405. <br /> Default is <i>False</i>. This is backwards compatible and saves memory.
  406. "Blank" cells (those with their own formatting information but no data) are treated as empty
  407. (by ignoring the file's BLANK and MULBLANK records).
  408. It cuts off any bottom "margin" of rows of empty (and blank) cells and
  409. any right "margin" of columns of empty (and blank) cells.
  410. Only cell_value and cell_type are available.
  411. <br /> <i>True</i> provides all cells, including empty and blank cells.
  412. XF information is available for each cell.
  413. <br /> -- New in version 0.6.1
  414. </dd>
  415. <dt><i>on_demand</i></dt>
  416. <dd>
  417. Governs whether sheets are all loaded initially or when demanded
  418. by the caller. Please refer back to the section &quot;Loading worksheets on demand&quot; for details.
  419. <br /> -- New in version 0.7.1
  420. </dd>
  421. <dt><i>ragged_rows</i></dt>
  422. <dd>
  423. False (the default) means all rows are padded out with empty cells so that all
  424. rows have the same size (Sheet.ncols). True means that there are no empty cells at the ends of rows.
  425. This can result in substantial memory savings if rows are of widely varying sizes. See also the
  426. Sheet.row_len() method.
  427. <br /> -- New in version 0.7.2
  428. </dd>
  429. <dt>Returns:</dt>
  430. <dd>
  431. An instance of the Book class.</dd>
  432. </dl><br />
  433. </dd>
  434. <dt><b>Operand(akind=None, avalue=None, arank=0, atext='?')</b> (class) [<a href='#formula.Operand-class'>#</a>]</dt>
  435. <dd>
  436. <p>Used in evaluating formulas.</p>
  437. <p>For more information about this class, see <a href='#formula.Operand-class'><i>The Operand Class</i></a>.</p>
  438. </dd>
  439. <dt><a id='formula.rangename3d-function' name='formula.rangename3d-function'><b>rangename3d(book, ref3d)</b></a> [<a href='#formula.rangename3d-function'>#</a>]</dt>
  440. <dd>
  441. <p>Utility function:
  442. <br /> Ref3D((1, 4, 5, 20, 7, 10)) =&gt; 'Sheet2:Sheet3!$H$6:$J$20'
  443. </p></dd>
  444. <dt><a id='formula.rangename3drel-function' name='formula.rangename3drel-function'><b>rangename3drel(book, ref3d, browx=None, bcolx=None, r1c1=0)</b></a> [<a href='#formula.rangename3drel-function'>#</a>]</dt>
  445. <dd>
  446. <p>Utility function:
  447. <br /> Ref3D(coords=(0, 1, -32, -22, -13, 13), relflags=(0, 0, 1, 1, 1, 1))
  448. R1C1 mode =&gt; 'Sheet1!R[-32]C[-13]:R[-23]C[12]'
  449. A1 mode =&gt; depends on base cell (browx, bcolx)
  450. </p></dd>
  451. <dt><b>Ref3D(atuple)</b> (class) [<a href='#formula.Ref3D-class'>#</a>]</dt>
  452. <dd>
  453. <p>Represents an absolute or relative 3-dimensional reference to a box
  454. of one or more cells.</p>
  455. <p>For more information about this class, see <a href='#formula.Ref3D-class'><i>The Ref3D Class</i></a>.</p>
  456. </dd>
  457. <dt><b>Rowinfo()</b> (class) [<a href='#sheet.Rowinfo-class'>#</a>]</dt>
  458. <dd>
  459. <p>Height and default formatting information that applies to a row in a sheet.</p>
  460. <p>For more information about this class, see <a href='#sheet.Rowinfo-class'><i>The Rowinfo Class</i></a>.</p>
  461. </dd>
  462. <dt><b>Sheet(book, position, name, number)</b> (class) [<a href='#sheet.Sheet-class'>#</a>]</dt>
  463. <dd>
  464. <p>Contains the data for one worksheet.</p>
  465. <p>For more information about this class, see <a href='#sheet.Sheet-class'><i>The Sheet Class</i></a>.</p>
  466. </dd>
  467. <dt><b>XF</b> (class) [<a href='#formatting.XF-class'>#</a>]</dt>
  468. <dd>
  469. <p>eXtended Formatting information for cells, rows, columns and styles.</p>
  470. <p>For more information about this class, see <a href='#formatting.XF-class'><i>The XF Class</i></a>.</p>
  471. </dd>
  472. <dt><b>XFAlignment</b> (class) [<a href='#formatting.XFAlignment-class'>#</a>]</dt>
  473. <dd>
  474. <p>A collection of the alignment and similar attributes of an XF record.</p>
  475. <p>For more information about this class, see <a href='#formatting.XFAlignment-class'><i>The XFAlignment Class</i></a>.</p>
  476. </dd>
  477. <dt><b>XFBackground</b> (class) [<a href='#formatting.XFBackground-class'>#</a>]</dt>
  478. <dd>
  479. <p>A collection of the background-related attributes of an XF record.</p>
  480. <p>For more information about this class, see <a href='#formatting.XFBackground-class'><i>The XFBackground Class</i></a>.</p>
  481. </dd>
  482. <dt><b>XFBorder</b> (class) [<a href='#formatting.XFBorder-class'>#</a>]</dt>
  483. <dd>
  484. <p>A collection of the border-related attributes of an XF record.</p>
  485. <p>For more information about this class, see <a href='#formatting.XFBorder-class'><i>The XFBorder Class</i></a>.</p>
  486. </dd>
  487. <dt><b>XFProtection</b> (class) [<a href='#formatting.XFProtection-class'>#</a>]</dt>
  488. <dd>
  489. <p>A collection of the protection-related attributes of an XF record.</p>
  490. <p>For more information about this class, see <a href='#formatting.XFProtection-class'><i>The XFProtection Class</i></a>.</p>
  491. </dd>
  492. <dt><a id='xldate.xldate_as_tuple-function' name='xldate.xldate_as_tuple-function'><b>xldate_as_tuple(xldate, datemode)</b></a> [<a href='#xldate.xldate_as_tuple-function'>#</a>]</dt>
  493. <dd>
  494. <p>Convert an Excel number (presumed to represent a date, a datetime or a time) into
  495. a tuple suitable for feeding to datetime or mx.DateTime constructors.</p>
  496. <dl>
  497. <dt><i>xldate</i></dt>
  498. <dd>
  499. The Excel number</dd>
  500. <dt><i>datemode</i></dt>
  501. <dd>
  502. 0: 1900-based, 1: 1904-based.
  503. <br />WARNING: when using this function to
  504. interpret the contents of a workbook, you should pass in the Book.datemode
  505. attribute of that workbook. Whether
  506. the workbook has ever been anywhere near a Macintosh is irrelevant.
  507. </dd>
  508. <dt>Returns:</dt>
  509. <dd>
  510. Gregorian (year, month, day, hour, minute, nearest_second).
  511. <br />Special case: if 0.0 &lt;= xldate &lt; 1.0, it is assumed to represent a time;
  512. (0, 0, 0, hour, minute, second) will be returned.
  513. <br />Note: 1904-01-01 is not regarded as a valid date in the datemode 1 system; its "serial number"
  514. is zero.
  515. </dd>
  516. <dt>Raises <b>XLDateNegative</b>:</dt><dd>
  517. xldate &lt; 0.00
  518. </dd>
  519. <dt>Raises <b>XLDateAmbiguous</b>:</dt><dd>
  520. The 1900 leap-year problem (datemode == 0 and 1.0 &lt;= xldate &lt; 61.0)
  521. </dd>
  522. <dt>Raises <b>XLDateTooLarge</b>:</dt><dd>
  523. Gregorian year 10000 or later</dd>
  524. <dt>Raises <b>XLDateBadDatemode</b>:</dt><dd>
  525. datemode arg is neither 0 nor 1</dd>
  526. <dt>Raises <b>XLDateError</b>:</dt><dd>
  527. Covers the 4 specific errors</dd>
  528. </dl><br />
  529. </dd>
  530. <dt><a id='xldate.xldate_from_date_tuple-function' name='xldate.xldate_from_date_tuple-function'><b>xldate_from_date_tuple((year, month, day), datemode)</b></a> [<a href='#xldate.xldate_from_date_tuple-function'>#</a>]</dt>
  531. <dd>
  532. <p>Convert a date tuple (year, month, day) to an Excel date.</p>
  533. <dl>
  534. <dt><i>year</i></dt>
  535. <dd>
  536. Gregorian year.</dd>
  537. <dt><i>month</i></dt>
  538. <dd>
  539. 1 &lt;= month &lt;= 12
  540. </dd>
  541. <dt><i>day</i></dt>
  542. <dd>
  543. 1 &lt;= day &lt;= last day of that (year, month)
  544. </dd>
  545. <dt><i>datemode</i></dt>
  546. <dd>
  547. 0: 1900-based, 1: 1904-based.</dd>
  548. <dt>Raises <b>XLDateAmbiguous</b>:</dt><dd>
  549. The 1900 leap-year problem (datemode == 0 and 1.0 &lt;= xldate &lt; 61.0)
  550. </dd>
  551. <dt>Raises <b>XLDateBadDatemode</b>:</dt><dd>
  552. datemode arg is neither 0 nor 1</dd>
  553. <dt>Raises <b>XLDateBadTuple</b>:</dt><dd>
  554. (year, month, day) is too early/late or has invalid component(s)</dd>
  555. <dt>Raises <b>XLDateError</b>:</dt><dd>
  556. Covers the specific errors</dd>
  557. </dl><br />
  558. </dd>
  559. <dt><a id='xldate.xldate_from_datetime_tuple-function' name='xldate.xldate_from_datetime_tuple-function'><b>xldate_from_datetime_tuple(datetime_tuple, datemode)</b></a> [<a href='#xldate.xldate_from_datetime_tuple-function'>#</a>]</dt>
  560. <dd>
  561. <p>Convert a datetime tuple (year, month, day, hour, minute, second) to an Excel date value.
  562. For more details, refer to other xldate_from_*_tuple functions.</p>
  563. <dl>
  564. <dt><i>datetime_tuple</i></dt>
  565. <dd>
  566. (year, month, day, hour, minute, second)</dd>
  567. <dt><i>datemode</i></dt>
  568. <dd>
  569. 0: 1900-based, 1: 1904-based.</dd>
  570. </dl><br />
  571. </dd>
  572. <dt><a id='xldate.xldate_from_time_tuple-function' name='xldate.xldate_from_time_tuple-function'><b>xldate_from_time_tuple((hour, minute, second))</b></a> [<a href='#xldate.xldate_from_time_tuple-function'>#</a>]</dt>
  573. <dd>
  574. <p>Convert a time tuple (hour, minute, second) to an Excel &quot;date&quot; value (fraction of a day).</p>
  575. <dl>
  576. <dt><i>hour</i></dt>
  577. <dd>
  578. 0 &lt;= hour &lt; 24
  579. </dd>
  580. <dt><i>minute</i></dt>
  581. <dd>
  582. 0 &lt;= minute &lt; 60
  583. </dd>
  584. <dt><i>second</i></dt>
  585. <dd>
  586. 0 &lt;= second &lt; 60
  587. </dd>
  588. <dt>Raises <b>XLDateBadTuple</b>:</dt><dd>
  589. Out-of-range hour, minute, or second</dd>
  590. </dl><br />
  591. </dd>
  592. </dl>
  593. <h2><a id='biffh.BaseObject-class' name='biffh.BaseObject-class'>The BaseObject Class</a></h2>
  594. <dl>
  595. <dt><b>BaseObject</b> (class) [<a href='#biffh.BaseObject-class'>#</a>]</dt>
  596. <dd>
  597. <p>Parent of almost all other classes in the package. Defines a common &quot;dump&quot; method
  598. for debugging.</p>
  599. </dd>
  600. <dt><a id='biffh.BaseObject.dump-method' name='biffh.BaseObject.dump-method'><b>dump(f=None, header=None, footer=None, indent=0)</b></a> [<a href='#biffh.BaseObject.dump-method'>#</a>]</dt>
  601. <dd>
  602. <dl>
  603. <dt><i>f</i></dt>
  604. <dd>
  605. open file object, to which the dump is written</dd>
  606. <dt><i>header</i></dt>
  607. <dd>
  608. text to write before the dump</dd>
  609. <dt><i>footer</i></dt>
  610. <dd>
  611. text to write after the dump</dd>
  612. <dt><i>indent</i></dt>
  613. <dd>
  614. number of leading spaces (for recursive calls)</dd>
  615. </dl><br />
  616. </dd>
  617. </dl>
  618. <h2><a id='__init__.Book-class' name='__init__.Book-class'>The Book Class</a></h2>
  619. <dl>
  620. <dt><b>Book()</b> (class) [<a href='#__init__.Book-class'>#</a>]</dt>
  621. <dd>
  622. <p>Contents of a "workbook".
  623. </p><p>WARNING: You don't call this class yourself. You use the Book object that
  624. was returned when you called xlrd.open_workbook("myfile.xls").</p>
  625. </dd>
  626. <dt><a id='__init__.Book.biff_version-attribute' name='__init__.Book.biff_version-attribute'><b>biff_version</b></a> [<a href='#__init__.Book.biff_version-attribute'>#</a>]</dt>
  627. <dd>
  628. <p>Version of BIFF (Binary Interchange File Format) used to create the file.
  629. Latest is 8.0 (represented here as 80), introduced with Excel 97.
  630. Earliest supported by this module: 2.0 (represented as 20).</p>
  631. </dd>
  632. <dt><a id='__init__.Book.codepage-attribute' name='__init__.Book.codepage-attribute'><b>codepage</b></a> [<a href='#__init__.Book.codepage-attribute'>#</a>]</dt>
  633. <dd>
  634. <p>An integer denoting the character set used for strings in this file.
  635. For BIFF 8 and later, this will be 1200, meaning Unicode; more precisely, UTF_16_LE.
  636. For earlier versions, this is used to derive the appropriate Python encoding
  637. to be used to convert to Unicode.
  638. Examples: 1252 -&gt; 'cp1252', 10000 -&gt; 'mac_roman'</p>
  639. </dd>
  640. <dt><a id='__init__.Book.colour_map-attribute' name='__init__.Book.colour_map-attribute'><b>colour_map</b></a> [<a href='#__init__.Book.colour_map-attribute'>#</a>]</dt>
  641. <dd>
  642. <p>This provides definitions for colour indexes. Please refer to the
  643. above section "The Palette; Colour Indexes" for an explanation
  644. of how colours are represented in Excel.<br />
  645. Colour indexes into the palette map into (red, green, blue) tuples.
  646. "Magic" indexes e.g. 0x7FFF map to None.
  647. <i>colour_map</i> is what you need if you want to render cells on screen or in a PDF
  648. file. If you are writing an output XLS file, use <i>palette_record</i>.
  649. <br /> -- New in version 0.6.1. Extracted only if open_workbook(..., formatting_info=True)
  650. </p></dd>
  651. <dt><a id='__init__.Book.countries-attribute' name='__init__.Book.countries-attribute'><b>countries</b></a> [<a href='#__init__.Book.countries-attribute'>#</a>]</dt>
  652. <dd>
  653. <p>A tuple containing the (telephone system) country code for:<br />
  654. [0]: the user-interface setting when the file was created.<br />
  655. [1]: the regional settings.<br />
  656. Example: (1, 61) meaning (USA, Australia).
  657. This information may give a clue to the correct encoding for an unknown codepage.
  658. For a long list of observed values, refer to the OpenOffice.org documentation for
  659. the COUNTRY record.
  660. </p></dd>
  661. <dt><a id='__init__.Book.datemode-attribute' name='__init__.Book.datemode-attribute'><b>datemode</b></a> [<a href='#__init__.Book.datemode-attribute'>#</a>]</dt>
  662. <dd>
  663. <p>Which date system was in force when this file was last saved.<br />
  664. 0 =&gt; 1900 system (the Excel for Windows default).<br />
  665. 1 =&gt; 1904 system (the Excel for Macintosh default).<br />
  666. </p></dd>
  667. <dt><a id='__init__.Book.encoding-attribute' name='__init__.Book.encoding-attribute'><b>encoding</b></a> [<a href='#__init__.Book.encoding-attribute'>#</a>]</dt>
  668. <dd>
  669. <p>The encoding that was derived from the codepage.</p>
  670. </dd>
  671. <dt><a id='__init__.Book.font_list-attribute' name='__init__.Book.font_list-attribute'><b>font_list</b></a> [<a href='#__init__.Book.font_list-attribute'>#</a>]</dt>
  672. <dd>
  673. <p>A list of Font class instances, each corresponding to a FONT record.
  674. <br /> -- New in version 0.6.1
  675. </p></dd>
  676. <dt><a id='__init__.Book.format_list-attribute' name='__init__.Book.format_list-attribute'><b>format_list</b></a> [<a href='#__init__.Book.format_list-attribute'>#</a>]</dt>
  677. <dd>
  678. <p>A list of Format objects, each corresponding to a FORMAT record, in
  679. the order that they appear in the input file.
  680. It does <i>not</i> contain builtin formats.
  681. If you are creating an output file using (for example) pyExcelerator,
  682. use this list.
  683. The collection to be used for all visual rendering purposes is format_map.
  684. <br /> -- New in version 0.6.1
  685. </p></dd>
  686. <dt><a id='__init__.Book.format_map-attribute' name='__init__.Book.format_map-attribute'><b>format_map</b></a> [<a href='#__init__.Book.format_map-attribute'>#</a>]</dt>
  687. <dd>
  688. <p>The mapping from XF.format_key to Format object.
  689. <br /> -- New in version 0.6.1
  690. </p></dd>
  691. <dt><a id='__init__.Book.load_time_stage_1-attribute' name='__init__.Book.load_time_stage_1-attribute'><b>load_time_stage_1</b></a> [<a href='#__init__.Book.load_time_stage_1-attribute'>#</a>]</dt>
  692. <dd>
  693. <p>Time in seconds to extract the XLS image as a contiguous string (or mmap equivalent).</p>
  694. </dd>
  695. <dt><a id='__init__.Book.load_time_stage_2-attribute' name='__init__.Book.load_time_stage_2-attribute'><b>load_time_stage_2</b></a> [<a href='#__init__.Book.load_time_stage_2-attribute'>#</a>]</dt>
  696. <dd>
  697. <p>Time in seconds to parse the data from the contiguous string (or mmap equivalent).</p>
  698. </dd>
  699. <dt><a id='__init__.Book.name_and_scope_map-attribute' name='__init__.Book.name_and_scope_map-attribute'><b>name_and_scope_map</b></a> [<a href='#__init__.Book.name_and_scope_map-attribute'>#</a>]</dt>
  700. <dd>
  701. <p>A mapping from (lower_case_name, scope) to a single Name object.
  702. <br /> -- New in version 0.6.0
  703. </p></dd>
  704. <dt><a id='__init__.Book.name_map-attribute' name='__init__.Book.name_map-attribute'><b>name_map</b></a> [<a href='#__init__.Book.name_map-attribute'>#</a>]</dt>
  705. <dd>
  706. <p>A mapping from lower_case_name to a list of Name objects. The list is
  707. sorted in scope order. Typically there will be one item (of global scope)
  708. in the list.
  709. <br /> -- New in version 0.6.0
  710. </p></dd>
  711. <dt><a id='__init__.Book.name_obj_list-attribute' name='__init__.Book.name_obj_list-attribute'><b>name_obj_list</b></a> [<a href='#__init__.Book.name_obj_list-attribute'>#</a>]</dt>
  712. <dd>
  713. <p>List containing a Name object for each NAME record in the workbook.
  714. <br /> -- New in version 0.6.0
  715. </p></dd>
  716. <dt><a id='__init__.Book.nsheets-attribute' name='__init__.Book.nsheets-attribute'><b>nsheets</b></a> [<a href='#__init__.Book.nsheets-attribute'>#</a>]</dt>
  717. <dd>
  718. <p>The number of worksheets present in the workbook file.
  719. This information is available even when no sheets have yet been loaded.</p>
  720. </dd>
  721. <dt><a id='__init__.Book.palette_record-attribute' name='__init__.Book.palette_record-attribute'><b>palette_record</b></a> [<a href='#__init__.Book.palette_record-attribute'>#</a>]</dt>
  722. <dd>
  723. <p>If the user has changed any of the colours in the standard palette, the XLS
  724. file will contain a PALETTE record with 56 (16 for Excel 4.0 and earlier)
  725. RGB values in it, and this list will be e.g. [(r0, b0, g0), ..., (r55, b55, g55)].
  726. Otherwise this list will be empty. This is what you need if you are
  727. writing an output XLS file. If you want to render cells on screen or in a PDF
  728. file, use colour_map.
  729. <br /> -- New in version 0.6.1. Extracted only if open_workbook(..., formatting_info=True)
  730. </p></dd>
  731. <dt><a id='__init__.Book.release_resources-method' name='__init__.Book.release_resources-method'><b>release_resources()</b></a> [<a href='#__init__.Book.release_resources-method'>#</a>]</dt>
  732. <dd>
  733. <p>This method has a dual purpose. You can call it to release
  734. memory-consuming objects and (possibly) a memory-mapped file
  735. (mmap.mmap object) when you have finished loading sheets in
  736. on_demand mode, but still require the Book object to examine the
  737. loaded sheets. It is also called automatically (a) when open_workbook
  738. raises an exception and (b) if you are using a &quot;with&quot; statement, when
  739. the &quot;with&quot; block is exited. Calling this method multiple times on the
  740. same object has no ill effect.</p>
  741. </dd>
  742. <dt><a id='__init__.Book.sheet_by_index-method' name='__init__.Book.sheet_by_index-method'><b>sheet_by_index(sheetx)</b></a> [<a href='#__init__.Book.sheet_by_index-method'>#</a>]</dt>
  743. <dd>
  744. <dl>
  745. <dt><i>sheetx</i></dt>
  746. <dd>
  747. Sheet index in range(nsheets)</dd>
  748. <dt>Returns:</dt>
  749. <dd>
  750. An object of the Sheet class</dd>
  751. </dl><br />
  752. </dd>
  753. <dt><a id='__init__.Book.sheet_by_name-method' name='__init__.Book.sheet_by_name-method'><b>sheet_by_name(sheet_name)</b></a> [<a href='#__init__.Book.sheet_by_name-method'>#</a>]</dt>
  754. <dd>
  755. <dl>
  756. <dt><i>sheet_name</i></dt>
  757. <dd>
  758. Name of sheet required</dd>
  759. <dt>Returns:</dt>
  760. <dd>
  761. An object of the Sheet class</dd>
  762. </dl><br />
  763. </dd>
  764. <dt><a id='__init__.Book.sheet_loaded-method' name='__init__.Book.sheet_loaded-method'><b>sheet_loaded(sheet_name_or_index)</b></a> [<a href='#__init__.Book.sheet_loaded-method'>#</a>]</dt>
  765. <dd>
  766. <dl>
  767. <dt><i>sheet_name_or_index</i></dt>
  768. <dd>
  769. Name or index of sheet enquired upon</dd>
  770. <dt>Returns:</dt>
  771. <dd>
  772. true if sheet is loaded, false otherwise
  773. <br /> -- New in version 0.7.1
  774. </dd>
  775. </dl><br />
  776. </dd>
  777. <dt><a id='__init__.Book.sheet_names-method' name='__init__.Book.sheet_names-method'><b>sheet_names()</b></a> [<a href='#__init__.Book.sheet_names-method'>#</a>]</dt>
  778. <dd>
  779. <dl>
  780. <dt>Returns:</dt>
  781. <dd>
  782. A list of the names of all the worksheets in the workbook file.
  783. This information is available even when no sheets have yet been loaded.</dd>
  784. </dl><br />
  785. </dd>
  786. <dt><a id='__init__.Book.sheets-method' name='__init__.Book.sheets-method'><b>sheets()</b></a> [<a href='#__init__.Book.sheets-method'>#</a>]</dt>
  787. <dd>
  788. <dl>
  789. <dt>Returns:</dt>
  790. <dd>
  791. A list of all sheets in the book.
  792. All sheets not already loaded will be loaded.</dd>
  793. </dl><br />
  794. </dd>
  795. <dt><a id='__init__.Book.style_name_map-attribute' name='__init__.Book.style_name_map-attribute'><b>style_name_map</b></a> [<a href='#__init__.Book.style_name_map-attribute'>#</a>]</dt>
  796. <dd>
  797. <p>This provides access via name to the extended format information for
  798. both built-in styles and user-defined styles.<br />
  799. It maps <i>name</i> to (<i>built_in</i>, <i>xf_index</i>), where:<br />
  800. <i>name</i> is either the name of a user-defined style,
  801. or the name of one of the built-in styles. Known built-in names are
  802. Normal, RowLevel_1 to RowLevel_7,
  803. ColLevel_1 to ColLevel_7, Comma, Currency, Percent, "Comma [0]",
  804. "Currency [0]", Hyperlink, and "Followed Hyperlink".<br />
  805. <i>built_in</i> 1 = built-in style, 0 = user-defined<br />
  806. <i>xf_index</i> is an index into Book.xf_list.<br />
  807. References: OOo docs s6.99 (STYLE record); Excel UI Format/Style
  808. <br /> -- New in version 0.6.1; since 0.7.4, extracted only if
  809. open_workbook(..., formatting_info=True)
  810. </p></dd>
  811. <dt><a id='__init__.Book.unload_sheet-method' name='__init__.Book.unload_sheet-method'><b>unload_sheet(sheet_name_or_index)</b></a> [<a href='#__init__.Book.unload_sheet-method'>#</a>]</dt>
  812. <dd>
  813. <dl>
  814. <dt><i>sheet_name_or_index</i></dt>
  815. <dd>
  816. Name or index of sheet to be unloaded.
  817. <br /> -- New in version 0.7.1
  818. </dd>
  819. </dl><br />
  820. </dd>
  821. <dt><a id='__init__.Book.user_name-attribute' name='__init__.Book.user_name-attribute'><b>user_name</b></a> [<a href='#__init__.Book.user_name-attribute'>#</a>]</dt>
  822. <dd>
  823. <p>What (if anything) is recorded as the name of the last user to save the file.</p>
  824. </dd>
  825. <dt><a id='__init__.Book.xf_list-attribute' name='__init__.Book.xf_list-attribute'><b>xf_list</b></a> [<a href='#__init__.Book.xf_list-attribute'>#</a>]</dt>
  826. <dd>
  827. <p>A list of XF class instances, each corresponding to an XF record.
  828. <br /> -- New in version 0.6.1
  829. </p></dd>
  830. </dl>
  831. <h2><a id='sheet.Cell-class' name='sheet.Cell-class'>The Cell Class</a></h2>
  832. <dl>
  833. <dt><b>Cell(ctype, value, xf_index=None)</b> (class) [<a href='#sheet.Cell-class'>#</a>]</dt>
  834. <dd>
  835. <p /><p>Contains the data for one cell.</p>
  836. <p>WARNING: You don't call this class yourself. You access Cell objects
  837. via methods of the <a class="link" href="#sheet.Sheet-class"><b>Sheet</b></a> object(s) that you found in the <a class="link" href="link:#Book"><b>Book</b></a> object that
  838. was returned when you called xlrd.open_workbook("myfile.xls").</p>
  839. <p> Cell objects have three attributes: <i>ctype</i> is an int, <i>value</i>
  840. (which depends on <i>ctype</i>) and <i>xf_index</i>.
  841. If "formatting_info" is not enabled when the workbook is opened, xf_index will be None.
  842. The following table describes the types of cells and how their values
  843. are represented in Python.</p>
  844. <table border="1" cellpadding="7">
  845. <tr>
  846. <th>Type symbol</th>
  847. <th>Type number</th>
  848. <th>Python value</th>
  849. </tr>
  850. <tr>
  851. <td>XL_CELL_EMPTY</td>
  852. <td align="center">0</td>
  853. <td>empty string u''</td>
  854. </tr>
  855. <tr>
  856. <td>XL_CELL_TEXT</td>
  857. <td align="center">1</td>
  858. <td>a Unicode string</td>
  859. </tr>
  860. <tr>
  861. <td>XL_CELL_NUMBER</td>
  862. <td align="center">2</td>
  863. <td>float</td>
  864. </tr>
  865. <tr>
  866. <td>XL_CELL_DATE</td>
  867. <td align="center">3</td>
  868. <td>float</td>
  869. </tr>
  870. <tr>
  871. <td>XL_CELL_BOOLEAN</td>
  872. <td align="center">4</td>
  873. <td>int; 1 means TRUE, 0 means FALSE</td>
  874. </tr>
  875. <tr>
  876. <td>XL_CELL_ERROR</td>
  877. <td align="center">5</td>
  878. <td>int representing internal Excel codes; for a text representation,
  879. refer to the supplied dictionary error_text_from_code</td>
  880. </tr>
  881. <tr>
  882. <td>XL_CELL_BLANK</td>
  883. <td align="center">6</td>
  884. <td>empty string u''. Note: this type will appear only when
  885. open_workbook(..., formatting_info=True) is used.</td>
  886. </tr>
  887. </table>
  888. <p />
  889. </dd>
  890. </dl>
  891. <h2><a id='sheet.Colinfo-class' name='sheet.Colinfo-class'>The Colinfo Class</a></h2>
  892. <dl>
  893. <dt><b>Colinfo</b> (class) [<a href='#sheet.Colinfo-class'>#</a>]</dt>
  894. <dd>
  895. <p>Width and default formatting information that applies to one or
  896. more columns in a sheet. Derived from COLINFO records.
  897. </p><p> Here is the default hierarchy for width, according to the OOo docs:
  898. <br />"""In BIFF3, if a COLINFO record is missing for a column,
  899. the width specified in the record DEFCOLWIDTH is used instead.
  900. <br />In BIFF4-BIFF7, the width set in this [COLINFO] record is only used,
  901. if the corresponding bit for this column is cleared in the GCW
  902. record, otherwise the column width set in the DEFCOLWIDTH record
  903. is used (the STANDARDWIDTH record is always ignored in this case [see footnote!]).
  904. <br />In BIFF8, if a COLINFO record is missing for a column,
  905. the width specified in the record STANDARDWIDTH is used.
  906. If this [STANDARDWIDTH] record is also missing,
  907. the column width of the record DEFCOLWIDTH is used instead."""
  908. <br />
  909. Footnote: The docs on the GCW record say this:
  910. """<br />
  911. If a bit is set, the corresponding column uses the width set in the STANDARDWIDTH
  912. record. If a bit is cleared, the corresponding column uses the width set in the
  913. COLINFO record for this column.
  914. <br />If a bit is set, and the worksheet does not contain the STANDARDWIDTH record, or if
  915. the bit is cleared, and the worksheet does not contain the COLINFO record, the DEFCOLWIDTH
  916. record of the worksheet will be used instead.
  917. <br />"""<br />
  918. At the moment (2007-01-17) xlrd is going with the GCW version of the story.
  919. Reference to the source may be useful: see the computed_column_width(colx) method
  920. of the Sheet class.
  921. <br />-- New in version 0.6.1
  922. </p>
  923. </dd>
  924. <dt><a id='sheet.Colinfo.bit1_flag-attribute' name='sheet.Colinfo.bit1_flag-attribute'><b>bit1_flag</b></a> [<a href='#sheet.Colinfo.bit1_flag-attribute'>#</a>]</dt>
  925. <dd>
  926. <p>Value of a 1-bit flag whose purpose is unknown
  927. but is often seen set to 1</p>
  928. </dd>
  929. <dt><a id='sheet.Colinfo.collapsed-attribute' name='sheet.Colinfo.collapsed-attribute'><b>collapsed</b></a> [<a href='#sheet.Colinfo.collapsed-attribute'>#</a>]</dt>
  930. <dd>
  931. <p>1 = column is collapsed</p>
  932. </dd>
  933. <dt><a id='sheet.Colinfo.hidden-attribute' name='sheet.Colinfo.hidden-attribute'><b>hidden</b></a> [<a href='#sheet.Colinfo.hidden-attribute'>#</a>]</dt>
  934. <dd>
  935. <p>1 = column is hidden</p>
  936. </dd>
  937. <dt><a id='sheet.Colinfo.outline_level-attribute' name='sheet.Colinfo.outline_level-attribute'><b>outline_level</b></a> [<a href='#sheet.Colinfo.outline_level-attribute'>#</a>]</dt>
  938. <dd>
  939. <p>Outline level of the column, in range(7).
  940. (0 = no outline)</p>
  941. </dd>
  942. <dt><a id='sheet.Colinfo.width-attribute' name='sheet.Colinfo.width-attribute'><b>width</b></a> [<a href='#sheet.Colinfo.width-attribute'>#</a>]</dt>
  943. <dd>
  944. <p>Width of the column in 1/256 of the width of the zero character,
  945. using default font (first FONT record in the file).</p>
  946. </dd>
  947. <dt><a id='sheet.Colinfo.xf_index-attribute' name='sheet.Colinfo.xf_index-attribute'><b>xf_index</b></a> [<a href='#sheet.Colinfo.xf_index-attribute'>#</a>]</dt>
  948. <dd>
  949. <p>XF index to be used for formatting empty cells.</p>
  950. </dd>
  951. </dl>
  952. <h2><a id='formatting.EqNeAttrs-class' name='formatting.EqNeAttrs-class'>The EqNeAttrs Class</a></h2>
  953. <dl>
  954. <dt><b>EqNeAttrs</b> (class) [<a href='#formatting.EqNeAttrs-class'>#</a>]</dt>
  955. <dd>
  956. <p>This mixin class exists solely so that Format, Font, and XF.... objects
  957. can be compared by value of their attributes.</p>
  958. </dd>
  959. </dl>
  960. <h2><a id='formatting.Font-class' name='formatting.Font-class'>The Font Class</a></h2>
  961. <dl>
  962. <dt><b>Font</b> (class) [<a href='#formatting.Font-class'>#</a>]</dt>
  963. <dd>
  964. <p>An Excel "font" contains the details of not only what is normally
  965. considered a font, but also several other display attributes.
  966. Items correspond to those in the Excel UI's Format/Cells/Font tab.
  967. <br /> -- New in version 0.6.1
  968. </p></dd>
  969. <dt><a id='formatting.Font.bold-attribute' name='formatting.Font.bold-attribute'><b>bold</b></a> [<a href='#formatting.Font.bold-attribute'>#</a>]</dt>
  970. <dd>
  971. <p>1 = Characters are bold. Redundant; see &quot;weight&quot; attribute.</p>
  972. </dd>
  973. <dt><a id='formatting.Font.character_set-attribute' name='formatting.Font.character_set-attribute'><b>character_set</b></a> [<a href='#formatting.Font.character_set-attribute'>#</a>]</dt>
  974. <dd>
  975. <p>Values: 0 = ANSI Latin, 1 = System default, 2 = Symbol,
  976. 77 = Apple Roman,
  977. 128 = ANSI Japanese Shift-JIS,
  978. 129 = ANSI Korean (Hangul),
  979. 130 = ANSI Korean (Johab),
  980. 134 = ANSI Chinese Simplified GBK,
  981. 136 = ANSI Chinese Traditional BIG5,
  982. 161 = ANSI Greek,
  983. 162 = ANSI Turkish,
  984. 163 = ANSI Vietnamese,
  985. 177 = ANSI Hebrew,
  986. 178 = ANSI Arabic,
  987. 186 = ANSI Baltic,
  988. 204 = ANSI Cyrillic,
  989. 222 = ANSI Thai,
  990. 238 = ANSI Latin II (Central European),
  991. 255 = OEM Latin I</p>
  992. </dd>
  993. <dt><a id='formatting.Font.colour_index-attribute' name='formatting.Font.colour_index-attribute'><b>colour_index</b></a> [<a href='#formatting.Font.colour_index-attribute'>#</a>]</dt>
  994. <dd>
  995. <p>An explanation of &quot;colour index&quot; is given in the Formatting
  996. section at the start of this document.</p>
  997. </dd>
  998. <dt><a id='formatting.Font.escapement-attribute' name='formatting.Font.escapement-attribute'><b>escapement</b></a> [<a href='#formatting.Font.escapement-attribute'>#</a>]</dt>
  999. <dd>
  1000. <p>1 = Superscript, 2 = Subscript.</p>
  1001. </dd>
  1002. <dt><a id='formatting.Font.family-attribute' name='formatting.Font.family-attribute'><b>family</b></a> [<a href='#formatting.Font.family-attribute'>#</a>]</dt>
  1003. <dd>
  1004. <p>0 = None (unknown or don't care)<br />
  1005. 1 = Roman (variable width, serifed)<br />
  1006. 2 = Swiss (variable width, sans-serifed)<br />
  1007. 3 = Modern (fixed width, serifed or sans-serifed)<br />
  1008. 4 = Script (cursive)<br />
  1009. 5 = Decorative (specialised, for example Old English, Fraktur)
  1010. </p></dd>
  1011. <dt><a id='formatting.Font.font_index-attribute' name='formatting.Font.font_index-attribute'><b>font_index</b></a> [<a href='#formatting.Font.font_index-attribute'>#</a>]</dt>
  1012. <dd>
  1013. <p>The 0-based index used to refer to this Font() instance.
  1014. Note that index 4 is never used; xlrd supplies a dummy place-holder.</p>
  1015. </dd>
  1016. <dt><a id='formatting.Font.height-attribute' name='formatting.Font.height-attribute'><b>height</b></a> [<a href='#formatting.Font.height-attribute'>#</a>]</dt>
  1017. <dd>
  1018. <p>Height of the font (in twips). A twip = 1/20 of a point.</p>
  1019. </dd>
  1020. <dt><a id='formatting.Font.italic-attribute' name='formatting.Font.italic-attribute'><b>italic</b></a> [<a href='#formatting.Font.italic-attribute'>#</a>]</dt>
  1021. <dd>
  1022. <p>1 = Characters are italic.</p>
  1023. </dd>
  1024. <dt><a id='formatting.Font.name-attribute' name='formatting.Font.name-attribute'><b>name</b></a> [<a href='#formatting.Font.name-attribute'>#</a>]</dt>
  1025. <dd>
  1026. <p>The name of the font. Example: u&quot;Arial&quot;</p>
  1027. </dd>
  1028. <dt><a id='formatting.Font.outline-attribute' name='formatting.Font.outline-attribute'><b>outline</b></a> [<a href='#formatting.Font.outline-attribute'>#</a>]</dt>
  1029. <dd>
  1030. <p>1 = Font is outline style (Macintosh only)</p>
  1031. </dd>
  1032. <dt><a id='formatting.Font.shadow-attribute' name='formatting.Font.shadow-attribute'><b>shadow</b></a> [<a href='#formatting.Font.shadow-attribute'>#</a>]</dt>
  1033. <dd>
  1034. <p>1 = Font is shadow style (Macintosh only)</p>
  1035. </dd>
  1036. <dt><a id='formatting.Font.struck_out-attribute' name='formatting.Font.struck_out-attribute'><b>struck_out</b></a> [<a href='#formatting.Font.struck_out-attribute'>#</a>]</dt>
  1037. <dd>
  1038. <p>1 = Characters are struck out.</p>
  1039. </dd>
  1040. <dt><a id='formatting.Font.underline_type-attribute' name='formatting.Font.underline_type-attribute'><b>underline_type</b></a> [<a href='#formatting.Font.underline_type-attribute'>#</a>]</dt>
  1041. <dd>
  1042. <p>0 = None<br />
  1043. 1 = Single; 0x21 (33) = Single accounting<br />
  1044. 2 = Double; 0x22 (34) = Double accounting
  1045. </p></dd>
  1046. <dt><a id='formatting.Font.underlined-attribute' name='formatting.Font.underlined-attribute'><b>underlined</b></a> [<a href='#formatting.Font.underlined-attribute'>#</a>]</dt>
  1047. <dd>
  1048. <p>1 = Characters are underlined. Redundant; see &quot;underline_type&quot; attribute.</p>
  1049. </dd>
  1050. <dt><a id='formatting.Font.weight-attribute' name='formatting.Font.weight-attribute'><b>weight</b></a> [<a href='#formatting.Font.weight-attribute'>#</a>]</dt>
  1051. <dd>
  1052. <p>Font weight (100-1000). Standard values are 400 for normal text
  1053. and 700 for bold text.</p>
  1054. </dd>
  1055. </dl>
  1056. <h2><a id='formatting.Format-class' name='formatting.Format-class'>The Format Class</a></h2>
  1057. <dl>
  1058. <dt><b>Format(format_key, ty, format_str)</b> (class) [<a href='#formatting.Format-class'>#</a>]</dt>
  1059. <dd>
  1060. <p>"Number format" information from a FORMAT record.
  1061. <br /> -- New in version 0.6.1
  1062. </p></dd>
  1063. <dt><a id='formatting.Format.format_key-attribute' name='formatting.Format.format_key-attribute'><b>format_key</b></a> [<a href='#formatting.Format.format_key-attribute'>#</a>]</dt>
  1064. <dd>
  1065. <p>The key into Book.format_map</p>
  1066. </dd>
  1067. <dt><a id='formatting.Format.format_str-attribute' name='formatting.Format.format_str-attribute'><b>format_str</b></a> [<a href='#formatting.Format.format_str-attribute'>#</a>]</dt>
  1068. <dd>
  1069. <p>The format string</p>
  1070. </dd>
  1071. <dt><a id='formatting.Format.type-attribute' name='formatting.Format.type-attribute'><b>type</b></a> [<a href='#formatting.Format.type-attribute'>#</a>]</dt>
  1072. <dd>
  1073. <p>A classification that has been inferred from the format string.
  1074. Currently, this is used only to distinguish between numbers and dates.
  1075. <br />Values:
  1076. <br />FUN = 0 # unknown
  1077. <br />FDT = 1 # date
  1078. <br />FNU = 2 # number
  1079. <br />FGE = 3 # general
  1080. <br />FTX = 4 # text
  1081. </p></dd>
  1082. </dl>
  1083. <h2><a id='sheet.Hyperlink-class' name='sheet.Hyperlink-class'>The Hyperlink Class</a></h2>
  1084. <dl>
  1085. <dt><b>Hyperlink</b> (class) [<a href='#sheet.Hyperlink-class'>#</a>]</dt>
  1086. <dd>
  1087. <p /><p>Contains the attributes of a hyperlink.
  1088. Hyperlink objects are accessible through Sheet.<a class="link" href="#sheet.Sheet.hyperlink_list-variable"><b>hyperlink_list</b></a>
  1089. and Sheet.<a class="link" href="#sheet.Sheet.hyperlink_map-variable"><b>hyperlink_map</b></a>.
  1090. <br />-- New in version 0.7.2
  1091. </p>
  1092. </dd>
  1093. <dt><a id='sheet.Hyperlink.desc-attribute' name='sheet.Hyperlink.desc-attribute'><b>desc</b></a> [<a href='#sheet.Hyperlink.desc-attribute'>#</a>]</dt>
  1094. <dd>
  1095. <p>Description ... this is displayed in the cell,
  1096. and should be identical to the cell value. Unicode string, or None. It seems
  1097. impossible NOT to have a description created by the Excel UI.</p>
  1098. </dd>
  1099. <dt><a id='sheet.Hyperlink.fcolx-attribute' name='sheet.Hyperlink.fcolx-attribute'><b>fcolx</b></a> [<a href='#sheet.Hyperlink.fcolx-attribute'>#</a>]</dt>
  1100. <dd>
  1101. <p>Index of first column</p>
  1102. </dd>
  1103. <dt><a id='sheet.Hyperlink.frowx-attribute' name='sheet.Hyperlink.frowx-attribute'><b>frowx</b></a> [<a href='#sheet.Hyperlink.frowx-attribute'>#</a>]</dt>
  1104. <dd>
  1105. <p>Index of first row</p>
  1106. </dd>
  1107. <dt><a id='sheet.Hyperlink.lcolx-attribute' name='sheet.Hyperlink.lcolx-attribute'><b>lcolx</b></a> [<a href='#sheet.Hyperlink.lcolx-attribute'>#</a>]</dt>
  1108. <dd>
  1109. <p>Index of last column</p>
  1110. </dd>
  1111. <dt><a id='sheet.Hyperlink.lrowx-attribute' name='sheet.Hyperlink.lrowx-attribute'><b>lrowx</b></a> [<a href='#sheet.Hyperlink.lrowx-attribute'>#</a>]</dt>
  1112. <dd>
  1113. <p>Index of last row</p>
  1114. </dd>
  1115. <dt><a id='sheet.Hyperlink.quicktip-attribute' name='sheet.Hyperlink.quicktip-attribute'><b>quicktip</b></a> [<a href='#sheet.Hyperlink.quicktip-attribute'>#</a>]</dt>
  1116. <dd>
  1117. <p>The text of the &quot;quick tip&quot; displayed when the cursor
  1118. hovers over the hyperlink.</p>
  1119. </dd>
  1120. <dt><a id='sheet.Hyperlink.target-attribute' name='sheet.Hyperlink.target-attribute'><b>target</b></a> [<a href='#sheet.Hyperlink.target-attribute'>#</a>]</dt>
  1121. <dd>
  1122. <p>Target frame. Unicode string. Note: I have not seen a case of this.
  1123. It seems impossible to create one in the Excel UI.</p>
  1124. </dd>
  1125. <dt><a id='sheet.Hyperlink.textmark-attribute' name='sheet.Hyperlink.textmark-attribute'><b>textmark</b></a> [<a href='#sheet.Hyperlink.textmark-attribute'>#</a>]</dt>
  1126. <dd>
  1127. <p>&quot;Textmark&quot;: the piece after the &quot;#&quot; in
  1128. &quot;http://docs.python.org/library#struct_module&quot;, or the Sheet1!A1:Z99
  1129. part when type is &quot;workbook&quot;.</p>
  1130. </dd>
  1131. <dt><a id='sheet.Hyperlink.type-attribute' name='sheet.Hyperlink.type-attribute'><b>type</b></a> [<a href='#sheet.Hyperlink.type-attribute'>#</a>]</dt>
  1132. <dd>
  1133. <p>Type of hyperlink. Unicode string, one of 'url', 'unc',
  1134. 'local file', 'workbook', 'unknown'</p>
  1135. </dd>
  1136. <dt><a id='sheet.Hyperlink.url_or_path-attribute' name='sheet.Hyperlink.url_or_path-attribute'><b>url_or_path</b></a> [<a href='#sheet.Hyperlink.url_or_path-attribute'>#</a>]</dt>
  1137. <dd>
  1138. <p>The URL or file-path, depending in the type. Unicode string, except
  1139. in the rare case of a local but non-existent file with non-ASCII
  1140. characters in the name, in which case only the "8.3" filename is available,
  1141. as a bytes (3.x) or str (2.x) string, <i>with unknown encoding.</i>
  1142. </p></dd>
  1143. </dl>
  1144. <h2><a id='__init__.Name-class' name='__init__.Name-class'>The Name Class</a></h2>
  1145. <dl>
  1146. <dt><b>Name</b> (class) [<a href='#__init__.Name-class'>#</a>]</dt>
  1147. <dd>
  1148. <p>Information relating to a named reference, formula, macro, etc.
  1149. <br /> -- New in version 0.6.0
  1150. <br /> -- <i>Name information is <b>not</b> extracted from files older than
  1151. Excel 5.0 (Book.biff_version &lt; 50)</i>
  1152. </p></dd>
  1153. <dt><a id='__init__.Name.area2d-method' name='__init__.Name.area2d-method'><b>area2d(clipped=True)</b></a> [<a href='#__init__.Name.area2d-method'>#</a>]</dt>
  1154. <dd>
  1155. <p>This is a convenience method for the use case where the name
  1156. refers to one rectangular area in one worksheet.</p>
  1157. <dl>
  1158. <dt><i>clipped</i></dt>
  1159. <dd>
  1160. If true (the default), the returned rectangle is clipped
  1161. to fit in (0, sheet.nrows, 0, sheet.ncols) -- it is guaranteed that
  1162. 0 &lt;= rowxlo &lt;= rowxhi &lt;= sheet.nrows and that the number of usable rows
  1163. in the area (which may be zero) is rowxhi - rowxlo; likewise for columns.
  1164. </dd>
  1165. <dt>Returns:</dt>
  1166. <dd>
  1167. a tuple (sheet_object, rowxlo, rowxhi, colxlo, colxhi).</dd>
  1168. <dt>Raises <b>XLRDError</b>:</dt><dd>
  1169. The name is not a constant absolute reference
  1170. to a single area in a single sheet.</dd>
  1171. </dl><br />
  1172. </dd>
  1173. <dt><a id='__init__.Name.binary-attribute' name='__init__.Name.binary-attribute'><b>binary</b></a> [<a href='#__init__.Name.binary-attribute'>#</a>]</dt>
  1174. <dd>
  1175. <p>0 = Formula definition; 1 = Binary data<br /> <i>No examples have been sighted.</i>
  1176. </p></dd>
  1177. <dt><a id='__init__.Name.builtin-attribute' name='__init__.Name.builtin-attribute'><b>builtin</b></a> [<a href='#__init__.Name.builtin-attribute'>#</a>]</dt>
  1178. <dd>
  1179. <p>0 = User-defined name; 1 = Built-in name
  1180. (common examples: Print_Area, Print_Titles; see OOo docs for full list)</p>
  1181. </dd>
  1182. <dt><a id='__init__.Name.cell-method' name='__init__.Name.cell-method'><b>cell()</b></a> [<a href='#__init__.Name.cell-method'>#</a>]</dt>
  1183. <dd>
  1184. <p>This is a convenience method for the frequent use case where the name
  1185. refers to a single cell.</p>
  1186. <dl>
  1187. <dt>Returns:</dt>
  1188. <dd>
  1189. An instance of the Cell class.</dd>
  1190. <dt>Raises <b>XLRDError</b>:</dt><dd>
  1191. The name is not a constant absolute reference
  1192. to a single cell.</dd>
  1193. </dl><br />
  1194. </dd>
  1195. <dt><a id='__init__.Name.complex-attribute' name='__init__.Name.complex-attribute'><b>complex</b></a> [<a href='#__init__.Name.complex-attribute'>#</a>]</dt>
  1196. <dd>
  1197. <p>0 = Simple formula; 1 = Complex formula (array formula or user defined)<br />
  1198. <i>No examples have been sighted.</i>
  1199. </p></dd>
  1200. <dt><a id='__init__.Name.func-attribute' name='__init__.Name.func-attribute'><b>func</b></a> [<a href='#__init__.Name.func-attribute'>#</a>]</dt>
  1201. <dd>
  1202. <p>0 = Command macro; 1 = Function macro. Relevant only if macro == 1</p>
  1203. </dd>
  1204. <dt><a id='__init__.Name.funcgroup-attribute' name='__init__.Name.funcgroup-attribute'><b>funcgroup</b></a> [<a href='#__init__.Name.funcgroup-attribute'>#</a>]</dt>
  1205. <dd>
  1206. <p>Function group. Relevant only if macro == 1; see OOo docs for values.</p>
  1207. </dd>
  1208. <dt><a id='__init__.Name.hidden-attribute' name='__init__.Name.hidden-attribute'><b>hidden</b></a> [<a href='#__init__.Name.hidden-attribute'>#</a>]</dt>
  1209. <dd>
  1210. <p>0 = Visible; 1 = Hidden</p>
  1211. </dd>
  1212. <dt><a id='__init__.Name.macro-attribute' name='__init__.Name.macro-attribute'><b>macro</b></a> [<a href='#__init__.Name.macro-attribute'>#</a>]</dt>
  1213. <dd>
  1214. <p>0 = Standard name; 1 = Macro name</p>
  1215. </dd>
  1216. <dt><a id='__init__.Name.name-attribute' name='__init__.Name.name-attribute'><b>name</b></a> [<a href='#__init__.Name.name-attribute'>#</a>]</dt>
  1217. <dd>
  1218. <p>A Unicode string. If builtin, decoded as per OOo docs.</p>
  1219. </dd>
  1220. <dt><a id='__init__.Name.name_index-attribute' name='__init__.Name.name_index-attribute'><b>name_index</b></a> [<a href='#__init__.Name.name_index-attribute'>#</a>]</dt>
  1221. <dd>
  1222. <p>The index of this object in book.name_obj_list</p>
  1223. </dd>
  1224. <dt><a id='__init__.Name.raw_formula-attribute' name='__init__.Name.raw_formula-attribute'><b>raw_formula</b></a> [<a href='#__init__.Name.raw_formula-attribute'>#</a>]</dt>
  1225. <dd>
  1226. <p>An 8-bit string.</p>
  1227. </dd>
  1228. <dt><a id='__init__.Name.result-attribute' name='__init__.Name.result-attribute'><b>result</b></a> [<a href='#__init__.Name.result-attribute'>#</a>]</dt>
  1229. <dd>
  1230. <p>The result of evaluating the formula, if any.
  1231. If no formula, or evaluation of the formula encountered problems,
  1232. the result is None. Otherwise the result is a single instance of the
  1233. Operand class.</p>
  1234. </dd>
  1235. <dt><a id='__init__.Name.scope-attribute' name='__init__.Name.scope-attribute'><b>scope</b></a> [<a href='#__init__.Name.scope-attribute'>#</a>]</dt>
  1236. <dd>
  1237. <p>-1: The name is global (visible in all calculation sheets).<br />
  1238. -2: The name belongs to a macro sheet or VBA sheet.<br />
  1239. -3: The name is invalid.<br />
  1240. 0 &lt;= scope &lt; book.nsheets: The name is local to the sheet whose index is scope.
  1241. </p></dd>
  1242. <dt><a id='__init__.Name.vbasic-attribute' name='__init__.Name.vbasic-attribute'><b>vbasic</b></a> [<a href='#__init__.Name.vbasic-attribute'>#</a>]</dt>
  1243. <dd>
  1244. <p>0 = Sheet macro; 1 = VisualBasic macro. Relevant only if macro == 1</p>
  1245. </dd>
  1246. </dl>
  1247. <h2><a id='sheet.Note-class' name='sheet.Note-class'>The Note Class</a></h2>
  1248. <dl>
  1249. <dt><b>Note</b> (class) [<a href='#sheet.Note-class'>#</a>]</dt>
  1250. <dd>
  1251. <p /><p> Represents a user "comment" or "note".
  1252. Note objects are accessible through Sheet.<a class="link" href="#sheet.Sheet.cell_note_map-variable"><b>cell_note_map</b></a>.
  1253. <br />-- New in version 0.7.2
  1254. </p>
  1255. </dd>
  1256. <dt><a id='sheet.Note.author-attribute' name='sheet.Note.author-attribute'><b>author</b></a> [<a href='#sheet.Note.author-attribute'>#</a>]</dt>
  1257. <dd>
  1258. <p>Author of note</p>
  1259. </dd>
  1260. <dt><a id='sheet.Note.col_hidden-attribute' name='sheet.Note.col_hidden-attribute'><b>col_hidden</b></a> [<a href='#sheet.Note.col_hidden-attribute'>#</a>]</dt>
  1261. <dd>
  1262. <p>True if the containing column is hidden</p>
  1263. </dd>
  1264. <dt><a id='sheet.Note.colx-attribute' name='sheet.Note.colx-attribute'><b>colx</b></a> [<a href='#sheet.Note.colx-attribute'>#</a>]</dt>
  1265. <dd>
  1266. <p>Column index</p>
  1267. </dd>
  1268. <dt><a id='sheet.Note.rich_text_runlist-attribute' name='sheet.Note.rich_text_runlist-attribute'><b>rich_text_runlist</b></a> [<a href='#sheet.Note.rich_text_runlist-attribute'>#</a>]</dt>
  1269. <dd>
  1270. <p>List of (offset_in_string, font_index) tuples.
  1271. Unlike Sheet.<a class="link" href="#sheet.Sheet.rich_text_runlist_map-variable"><b>rich_text_runlist_map</b></a>, the first offset should always be 0.
  1272. </p></dd>
  1273. <dt><a id='sheet.Note.row_hidden-attribute' name='sheet.Note.row_hidden-attribute'><b>row_hidden</b></a> [<a href='#sheet.Note.row_hidden-attribute'>#</a>]</dt>
  1274. <dd>
  1275. <p>True if the containing row is hidden</p>
  1276. </dd>
  1277. <dt><a id='sheet.Note.rowx-attribute' name='sheet.Note.rowx-attribute'><b>rowx</b></a> [<a href='#sheet.Note.rowx-attribute'>#</a>]</dt>
  1278. <dd>
  1279. <p>Row index</p>
  1280. </dd>
  1281. <dt><a id='sheet.Note.show-attribute' name='sheet.Note.show-attribute'><b>show</b></a> [<a href='#sheet.Note.show-attribute'>#</a>]</dt>
  1282. <dd>
  1283. <p>True if note is always shown</p>
  1284. </dd>
  1285. <dt><a id='sheet.Note.text-attribute' name='sheet.Note.text-attribute'><b>text</b></a> [<a href='#sheet.Note.text-attribute'>#</a>]</dt>
  1286. <dd>
  1287. <p>Text of the note</p>
  1288. </dd>
  1289. </dl>
  1290. <h2><a id='formula.Operand-class' name='formula.Operand-class'>The Operand Class</a></h2>
  1291. <dl>
  1292. <dt><b>Operand(akind=None, avalue=None, arank=0, atext='?')</b> (class) [<a href='#formula.Operand-class'>#</a>]</dt>
  1293. <dd>
  1294. <p>Used in evaluating formulas.
  1295. The following table describes the kinds and how their values
  1296. are represented.</p>
  1297. <table border="1" cellpadding="7">
  1298. <tr>
  1299. <th>Kind symbol</th>
  1300. <th>Kind number</th>
  1301. <th>Value representation</th>
  1302. </tr>
  1303. <tr>
  1304. <td>oBOOL</td>
  1305. <td align="center">3</td>
  1306. <td>integer: 0 =&gt; False; 1 =&gt; True</td>
  1307. </tr>
  1308. <tr>
  1309. <td>oERR</td>
  1310. <td align="center">4</td>
  1311. <td>None, or an int error code (same as XL_CELL_ERROR in the Cell class).
  1312. </td>
  1313. </tr>
  1314. <tr>
  1315. <td>oMSNG</td>
  1316. <td align="center">5</td>
  1317. <td>Used by Excel as a placeholder for a missing (not supplied) function
  1318. argument. Should *not* appear as a final formula result. Value is None.</td>
  1319. </tr>
  1320. <tr>
  1321. <td>oNUM</td>
  1322. <td align="center">2</td>
  1323. <td>A float. Note that there is no way of distinguishing dates.</td>
  1324. </tr>
  1325. <tr>
  1326. <td>oREF</td>
  1327. <td align="center">-1</td>
  1328. <td>The value is either None or a non-empty list of
  1329. absolute Ref3D instances.<br />
  1330. </td>
  1331. </tr>
  1332. <tr>
  1333. <td>oREL</td>
  1334. <td align="center">-2</td>
  1335. <td>The value is None or a non-empty list of
  1336. fully or partially relative Ref3D instances.
  1337. </td>
  1338. </tr>
  1339. <tr>
  1340. <td>oSTRG</td>
  1341. <td align="center">1</td>
  1342. <td>A Unicode string.</td>
  1343. </tr>
  1344. <tr>
  1345. <td>oUNK</td>
  1346. <td align="center">0</td>
  1347. <td>The kind is unknown or ambiguous. The value is None</td>
  1348. </tr>
  1349. </table>
  1350. <p />
  1351. </dd>
  1352. <dt><a id='formula.Operand.kind-attribute' name='formula.Operand.kind-attribute'><b>kind</b></a> [<a href='#formula.Operand.kind-attribute'>#</a>]</dt>
  1353. <dd>
  1354. <p>oUNK means that the kind of operand is not known unambiguously.</p>
  1355. </dd>
  1356. <dt><a id='formula.Operand.text-attribute' name='formula.Operand.text-attribute'><b>text</b></a> [<a href='#formula.Operand.text-attribute'>#</a>]</dt>
  1357. <dd>
  1358. <p>The reconstituted text of the original formula. Function names will be
  1359. in English irrespective of the original language, which doesn't seem
  1360. to be recorded anywhere. The separator is &quot;,&quot;, not &quot;;&quot; or whatever else
  1361. might be more appropriate for the end-user's locale; patches welcome.</p>
  1362. </dd>
  1363. <dt><a id='formula.Operand.value-attribute' name='formula.Operand.value-attribute'><b>value</b></a> [<a href='#formula.Operand.value-attribute'>#</a>]</dt>
  1364. <dd>
  1365. <p>None means that the actual value of the operand is a variable
  1366. (depends on cell data), not a constant.</p>
  1367. </dd>
  1368. </dl>
  1369. <h2><a id='formula.Ref3D-class' name='formula.Ref3D-class'>The Ref3D Class</a></h2>
  1370. <dl>
  1371. <dt><b>Ref3D(atuple)</b> (class) [<a href='#formula.Ref3D-class'>#</a>]</dt>
  1372. <dd>
  1373. <p /><p>Represents an absolute or relative 3-dimensional reference to a box
  1374. of one or more cells.<br />
  1375. -- New in version 0.6.0
  1376. </p>
  1377. <p>The <i>coords</i> attribute is a tuple of the form:<br />
  1378. (shtxlo, shtxhi, rowxlo, rowxhi, colxlo, colxhi)<br />
  1379. where 0 &lt;= thingxlo &lt;= thingx &lt; thingxhi.<br />
  1380. Note that it is quite possible to have thingx &gt; nthings; for example
  1381. Print_Titles could have colxhi == 256 and/or rowxhi == 65536
  1382. irrespective of how many columns/rows are actually used in the worksheet.
  1383. The caller will need to decide how to handle this situation.
  1384. Keyword: IndexError :-)
  1385. </p>
  1386. <p>The components of the coords attribute are also available as individual
  1387. attributes: shtxlo, shtxhi, rowxlo, rowxhi, colxlo, and colxhi.</p>
  1388. <p>The <i>relflags</i> attribute is a 6-tuple of flags which indicate whether
  1389. the corresponding (sheet|row|col)(lo|hi) is relative (1) or absolute (0).<br />
  1390. Note that there is necessarily no information available as to what cell(s)
  1391. the reference could possibly be relative to. The caller must decide what if
  1392. any use to make of oREL operands. Note also that a partially relative
  1393. reference may well be a typo.
  1394. For example, define name A1Z10 as $a$1:$z10 (missing $ after z)
  1395. while the cursor is on cell Sheet3!A27.<br />
  1396. The resulting Ref3D instance will have coords = (2, 3, 0, -16, 0, 26)
  1397. and relflags = (0, 0, 0, 1, 0, 0).<br />
  1398. So far, only one possibility of a sheet-relative component in
  1399. a reference has been noticed: a 2D reference located in the "current sheet".
  1400. <br /> This will appear as coords = (0, 1, ...) and relflags = (1, 1, ...).
  1401. </p></dd>
  1402. </dl>
  1403. <h2><a id='sheet.Rowinfo-class' name='sheet.Rowinfo-class'>The Rowinfo Class</a></h2>
  1404. <dl>
  1405. <dt><b>Rowinfo()</b> (class) [<a href='#sheet.Rowinfo-class'>#</a>]</dt>
  1406. <dd>
  1407. <p /><p>Height and default formatting information that applies to a row in a sheet.
  1408. Derived from ROW records.
  1409. <br /> -- New in version 0.6.1</p>
  1410. <p><b>height</b>: Height of the row, in twips. One twip == 1/20 of a point.</p>
  1411. <p><b>has_default_height</b>: 0 = Row has custom height; 1 = Row has default height.</p>
  1412. <p><b>outline_level</b>: Outline level of the row (0 to 7) </p>
  1413. <p><b>outline_group_starts_ends</b>: 1 = Outline group starts or ends here (depending on where the
  1414. outline buttons are located, see WSBOOL record [TODO ??]),
  1415. <i>and</i> is collapsed </p>
  1416. <p><b>hidden</b>: 1 = Row is hidden (manually, or by a filter or outline group) </p>
  1417. <p><b>height_mismatch</b>: 1 = Row height and default font height do not match </p>
  1418. <p><b>has_default_xf_index</b>: 1 = the xf_index attribute is usable; 0 = ignore it </p>
  1419. <p><b>xf_index</b>: Index to default XF record for empty cells in this row.
  1420. Don't use this if has_default_xf_index == 0. </p>
  1421. <p><b>additional_space_above</b>: This flag is set, if the upper border of at least one cell in this row
  1422. or if the lower border of at least one cell in the row above is
  1423. formatted with a thick line style. Thin and medium line styles are not
  1424. taken into account. </p>
  1425. <p><b>additional_space_below</b>: This flag is set, if the lower border of at least one cell in this row
  1426. or if the upper border of at least one cell in the row below is
  1427. formatted with a medium or thick line style. Thin line styles are not
  1428. taken into account. </p>
  1429. </dd>
  1430. </dl>
  1431. <h2><a id='sheet.Sheet-class' name='sheet.Sheet-class'>The Sheet Class</a></h2>
  1432. <dl>
  1433. <dt><b>Sheet(book, position, name, number)</b> (class) [<a href='#sheet.Sheet-class'>#</a>]</dt>
  1434. <dd>
  1435. <p /><p>Contains the data for one worksheet.</p>
  1436. <p>In the cell access functions, "rowx" is a row index, counting from zero, and "colx" is a
  1437. column index, counting from zero.
  1438. Negative values for row/column indexes and slice positions are supported in the expected fashion.</p>
  1439. <p>For information about cell types and cell values, refer to the documentation of the <a class="link" href="#sheet.Cell-class"><b>Cell</b></a> class.</p>
  1440. <p>WARNING: You don't call this class yourself. You access Sheet objects via the Book object that
  1441. was returned when you called xlrd.open_workbook("myfile.xls").</p>
  1442. </dd>
  1443. <dt><a id='sheet.Sheet.book-attribute' name='sheet.Sheet.book-attribute'><b>book</b></a> [<a href='#sheet.Sheet.book-attribute'>#</a>]</dt>
  1444. <dd>
  1445. <p>A reference to the Book object to which this sheet belongs.
  1446. Example usage: some_sheet.book.datemode</p>
  1447. </dd>
  1448. <dt><a id='sheet.Sheet.cell-method' name='sheet.Sheet.cell-method'><b>cell(rowx, colx)</b></a> [<a href='#sheet.Sheet.cell-method'>#</a>]</dt>
  1449. <dd>
  1450. <p><a class="link" href="#sheet.Cell-class"><b>Cell</b></a> object in the given row and column.
  1451. </p></dd>
  1452. <dt><a id='sheet.Sheet.cell_note_map-attribute' name='sheet.Sheet.cell_note_map-attribute'><b>cell_note_map</b></a> [<a href='#sheet.Sheet.cell_note_map-attribute'>#</a>]</dt>
  1453. <dd>
  1454. <p /><p>A sparse mapping from (rowx, colx) to a <a class="link" href="#sheet.Note-class"><b>Note</b></a> object.
  1455. Cells not containing a note ("comment") are not mapped.
  1456. <br />-- New in version 0.7.2 </p>
  1457. </dd>
  1458. <dt><a id='sheet.Sheet.cell_type-method' name='sheet.Sheet.cell_type-method'><b>cell_type(rowx, colx)</b></a> [<a href='#sheet.Sheet.cell_type-method'>#</a>]</dt>
  1459. <dd>
  1460. <p>Type of the cell in the given row and column.
  1461. Refer to the documentation of the <a class="link" href="#sheet.Cell-class"><b>Cell</b></a> class.
  1462. </p></dd>
  1463. <dt><a id='sheet.Sheet.cell_value-method' name='sheet.Sheet.cell_value-method'><b>cell_value(rowx, colx)</b></a> [<a href='#sheet.Sheet.cell_value-method'>#</a>]</dt>
  1464. <dd>
  1465. <p>Value of the cell in the given row and column.</p>
  1466. </dd>
  1467. <dt><a id='sheet.Sheet.cell_xf_index-method' name='sheet.Sheet.cell_xf_index-method'><b>cell_xf_index(rowx, colx)</b></a> [<a href='#sheet.Sheet.cell_xf_index-method'>#</a>]</dt>
  1468. <dd>
  1469. <p>XF index of the cell in the given row and column.
  1470. This is an index into Book.<a class="link" href="link:#Book.xf_list"><b>xf_list</b></a>.
  1471. <br /> -- New in version 0.6.1
  1472. </p></dd>
  1473. <dt><a id='sheet.Sheet.col-method' name='sheet.Sheet.col-method'><b>col(colx)</b></a> [<a href='#sheet.Sheet.col-method'>#</a>]</dt>
  1474. <dd>
  1475. <p>Returns a sequence of the <a class="link" href="#sheet.Cell-class"><b>Cell</b></a> objects in the given column.
  1476. </p></dd>
  1477. <dt><a id='sheet.Sheet.col_label_ranges-attribute' name='sheet.Sheet.col_label_ranges-attribute'><b>col_label_ranges</b></a> [<a href='#sheet.Sheet.col_label_ranges-attribute'>#</a>]</dt>
  1478. <dd>
  1479. <p>List of address ranges of cells containing column labels.
  1480. These are set up in Excel by Insert &gt; Name &gt; Labels &gt; Columns.
  1481. <br /> -- New in version 0.6.0
  1482. <br />How to deconstruct the list:
  1483. <pre>
  1484. for crange in thesheet.col_label_ranges:
  1485. rlo, rhi, clo, chi = crange
  1486. for rx in xrange(rlo, rhi):
  1487. for cx in xrange(clo, chi):
  1488. print "Column label at (rowx=%d, colx=%d) is %r" \
  1489. (rx, cx, thesheet.cell_value(rx, cx))
  1490. </pre>
  1491. </p></dd>
  1492. <dt><a id='sheet.Sheet.col_slice-method' name='sheet.Sheet.col_slice-method'><b>col_slice(colx, start_rowx=0, end_rowx=None)</b></a> [<a href='#sheet.Sheet.col_slice-method'>#</a>]</dt>
  1493. <dd>
  1494. <p>Returns a slice of the <a class="link" href="#sheet.Cell-class"><b>Cell</b></a> objects in the given column.
  1495. </p></dd>
  1496. <dt><a id='sheet.Sheet.col_types-method' name='sheet.Sheet.col_types-method'><b>col_types(colx, start_rowx=0, end_rowx=None)</b></a> [<a href='#sheet.Sheet.col_types-method'>#</a>]</dt>
  1497. <dd>
  1498. <p>Returns a slice of the types of the cells in the given column.</p>
  1499. </dd>
  1500. <dt><a id='sheet.Sheet.col_values-method' name='sheet.Sheet.col_values-method'><b>col_values(colx, start_rowx=0, end_rowx=None)</b></a> [<a href='#sheet.Sheet.col_values-method'>#</a>]</dt>
  1501. <dd>
  1502. <p>Returns a slice of the values of the cells in the given column.</p>
  1503. </dd>
  1504. <dt><a id='sheet.Sheet.colinfo_map-attribute' name='sheet.Sheet.colinfo_map-attribute'><b>colinfo_map</b></a> [<a href='#sheet.Sheet.colinfo_map-attribute'>#</a>]</dt>
  1505. <dd>
  1506. <p>The map from a column index to a <a class="link" href="#sheet.Colinfo-class"><b>Colinfo</b></a> object. Often there is an entry
  1507. in COLINFO records for all column indexes in range(257).
  1508. Note that xlrd ignores the entry for the non-existent
  1509. 257th column. On the other hand, there may be no entry for unused columns.
  1510. <br /> -- New in version 0.6.1. Populated only if open_workbook(formatting_info=True).
  1511. </p></dd>
  1512. <dt><a id='sheet.Sheet.computed_column_width-method' name='sheet.Sheet.computed_column_width-method'><b>computed_column_width(colx)</b></a> [<a href='#sheet.Sheet.computed_column_width-method'>#</a>]</dt>
  1513. <dd>
  1514. <p>Determine column display width.
  1515. <br /> -- New in version 0.6.1
  1516. <br />
  1517. </p><dl>
  1518. <dt><i>colx</i></dt>
  1519. <dd>
  1520. Index of the queried column, range 0 to 255.
  1521. Note that it is possible to find out the width that will be used to display
  1522. columns with no cell information e.g. column IV (colx=255).</dd>
  1523. <dt>Returns:</dt>
  1524. <dd>
  1525. The column width that will be used for displaying
  1526. the given column by Excel, in units of 1/256th of the width of a
  1527. standard character (the digit zero in the first font).</dd>
  1528. </dl><br />
  1529. </dd>
  1530. <dt><a id='sheet.Sheet.default_additional_space_above-attribute' name='sheet.Sheet.default_additional_space_above-attribute'><b>default_additional_space_above</b></a> [<a href='#sheet.Sheet.default_additional_space_above-attribute'>#</a>]</dt>
  1531. <dd>
  1532. <p>Default value to be used for a row if there is
  1533. no ROW record for that row.
  1534. From the <i>optional</i> DEFAULTROWHEIGHT record.
  1535. </p></dd>
  1536. <dt><a id='sheet.Sheet.default_additional_space_below-attribute' name='sheet.Sheet.default_additional_space_below-attribute'><b>default_additional_space_below</b></a> [<a href='#sheet.Sheet.default_additional_space_below-attribute'>#</a>]</dt>
  1537. <dd>
  1538. <p>Default value to be used for a row if there is
  1539. no ROW record for that row.
  1540. From the <i>optional</i> DEFAULTROWHEIGHT record.
  1541. </p></dd>
  1542. <dt><a id='sheet.Sheet.default_row_height-attribute' name='sheet.Sheet.default_row_height-attribute'><b>default_row_height</b></a> [<a href='#sheet.Sheet.default_row_height-attribute'>#</a>]</dt>
  1543. <dd>
  1544. <p>Default value to be used for a row if there is
  1545. no ROW record for that row.
  1546. From the <i>optional</i> DEFAULTROWHEIGHT record.
  1547. </p></dd>
  1548. <dt><a id='sheet.Sheet.default_row_height_mismatch-attribute' name='sheet.Sheet.default_row_height_mismatch-attribute'><b>default_row_height_mismatch</b></a> [<a href='#sheet.Sheet.default_row_height_mismatch-attribute'>#</a>]</dt>
  1549. <dd>
  1550. <p>Default value to be used for a row if there is
  1551. no ROW record for that row.
  1552. From the <i>optional</i> DEFAULTROWHEIGHT record.
  1553. </p></dd>
  1554. <dt><a id='sheet.Sheet.default_row_hidden-attribute' name='sheet.Sheet.default_row_hidden-attribute'><b>default_row_hidden</b></a> [<a href='#sheet.Sheet.default_row_hidden-attribute'>#</a>]</dt>
  1555. <dd>
  1556. <p>Default value to be used for a row if there is
  1557. no ROW record for that row.
  1558. From the <i>optional</i> DEFAULTROWHEIGHT record.
  1559. </p></dd>
  1560. <dt><a id='sheet.Sheet.defcolwidth-attribute' name='sheet.Sheet.defcolwidth-attribute'><b>defcolwidth</b></a> [<a href='#sheet.Sheet.defcolwidth-attribute'>#</a>]</dt>
  1561. <dd>
  1562. <p>Default column width from DEFCOLWIDTH record, else None.
  1563. From the OOo docs:<br />
  1564. """Column width in characters, using the width of the zero character
  1565. from default font (first FONT record in the file). Excel adds some
  1566. extra space to the default width, depending on the default font and
  1567. default font size. The algorithm how to exactly calculate the resulting
  1568. column width is not known.<br />
  1569. Example: The default width of 8 set in this record results in a column
  1570. width of 8.43 using Arial font with a size of 10 points."""<br />
  1571. For the default hierarchy, refer to the <a class="link" href="#sheet.Colinfo-class"><b>Colinfo</b></a> class.
  1572. <br /> -- New in version 0.6.1
  1573. </p></dd>
  1574. <dt><a id='sheet.Sheet.gcw-attribute' name='sheet.Sheet.gcw-attribute'><b>gcw</b></a> [<a href='#sheet.Sheet.gcw-attribute'>#</a>]</dt>
  1575. <dd>
  1576. <p>A 256-element tuple corresponding to the contents of the GCW record for this sheet.
  1577. If no such record, treat as all bits zero.
  1578. Applies to BIFF4-7 only. See docs of the <a class="link" href="#sheet.Colinfo-class"><b>Colinfo</b></a> class for discussion.
  1579. </p></dd>
  1580. <dt><a id='sheet.Sheet.has_pane_record-attribute' name='sheet.Sheet.has_pane_record-attribute'><b>has_pane_record</b></a> [<a href='#sheet.Sheet.has_pane_record-attribute'>#</a>]</dt>
  1581. <dd>
  1582. <p>Boolean specifying if a PANE record was present, ignore unless you're xlutils.copy</p>
  1583. </dd>
  1584. <dt><a id='sheet.Sheet.horizontal_page_breaks-attribute' name='sheet.Sheet.horizontal_page_breaks-attribute'><b>horizontal_page_breaks</b></a> [<a href='#sheet.Sheet.horizontal_page_breaks-attribute'>#</a>]</dt>
  1585. <dd>
  1586. <p>A list of the horizontal page breaks in this sheet.
  1587. Breaks are tuples in the form (index of row after break, start col index, end col index).
  1588. Populated only if open_workbook(formatting_info=True).
  1589. <br /> -- New in version 0.7.2
  1590. </p></dd>
  1591. <dt><a id='sheet.Sheet.horz_split_first_visible-attribute' name='sheet.Sheet.horz_split_first_visible-attribute'><b>horz_split_first_visible</b></a> [<a href='#sheet.Sheet.horz_split_first_visible-attribute'>#</a>]</dt>
  1592. <dd>
  1593. <p>Index of first visible row in bottom frozen/split pane</p>
  1594. </dd>
  1595. <dt><a id='sheet.Sheet.horz_split_pos-attribute' name='sheet.Sheet.horz_split_pos-attribute'><b>horz_split_pos</b></a> [<a href='#sheet.Sheet.horz_split_pos-attribute'>#</a>]</dt>
  1596. <dd>
  1597. <p>Number of rows in top pane (frozen panes; for split panes, see comments below in code)</p>
  1598. </dd>
  1599. <dt><a id='sheet.Sheet.hyperlink_list-attribute' name='sheet.Sheet.hyperlink_list-attribute'><b>hyperlink_list</b></a> [<a href='#sheet.Sheet.hyperlink_list-attribute'>#</a>]</dt>
  1600. <dd>
  1601. <p /><p>A list of <a class="link" href="#sheet.Hyperlink-class"><b>Hyperlink</b></a> objects corresponding to HLINK records found
  1602. in the worksheet.<br />-- New in version 0.7.2 </p>
  1603. </dd>
  1604. <dt><a id='sheet.Sheet.hyperlink_map-attribute' name='sheet.Sheet.hyperlink_map-attribute'><b>hyperlink_map</b></a> [<a href='#sheet.Sheet.hyperlink_map-attribute'>#</a>]</dt>
  1605. <dd>
  1606. <p /><p>A sparse mapping from (rowx, colx) to an item in <a class="link" href="#sheet.Sheet.hyperlink_list-variable"><b>hyperlink_list</b></a>.
  1607. Cells not covered by a hyperlink are not mapped.
  1608. It is possible using the Excel UI to set up a hyperlink that
  1609. covers a larger-than-1x1 rectangle of cells.
  1610. Hyperlink rectangles may overlap (Excel doesn't check).
  1611. When a multiply-covered cell is clicked on, the hyperlink that is activated
  1612. (and the one that is mapped here) is the last in hyperlink_list.
  1613. <br />-- New in version 0.7.2 </p>
  1614. </dd>
  1615. <dt><a id='sheet.Sheet.merged_cells-attribute' name='sheet.Sheet.merged_cells-attribute'><b>merged_cells</b></a> [<a href='#sheet.Sheet.merged_cells-attribute'>#</a>]</dt>
  1616. <dd>
  1617. <p>List of address ranges of cells which have been merged.
  1618. These are set up in Excel by Format &gt; Cells &gt; Alignment, then ticking
  1619. the "Merge cells" box.
  1620. <br /> -- New in version 0.6.1. Extracted only if open_workbook(formatting_info=True).
  1621. <br />How to deconstruct the list:
  1622. <pre>
  1623. for crange in thesheet.merged_cells:
  1624. rlo, rhi, clo, chi = crange
  1625. for rowx in xrange(rlo, rhi):
  1626. for colx in xrange(clo, chi):
  1627. # cell (rlo, clo) (the top left one) will carry the data
  1628. # and formatting info; the remainder will be recorded as
  1629. # blank cells, but a renderer will apply the formatting info
  1630. # for the top left cell (e.g. border, pattern) to all cells in
  1631. # the range.
  1632. </pre>
  1633. </p></dd>
  1634. <dt><a id='sheet.Sheet.name-attribute' name='sheet.Sheet.name-attribute'><b>name</b></a> [<a href='#sheet.Sheet.name-attribute'>#</a>]</dt>
  1635. <dd>
  1636. <p>Name of sheet.</p>
  1637. </dd>
  1638. <dt><a id='sheet.Sheet.ncols-attribute' name='sheet.Sheet.ncols-attribute'><b>ncols</b></a> [<a href='#sheet.Sheet.ncols-attribute'>#</a>]</dt>
  1639. <dd>
  1640. <p>Nominal number of columns in sheet. It is 1 + the maximum column index
  1641. found, ignoring trailing empty cells. See also open_workbook(ragged_rows=?)
  1642. and Sheet.<a class="link" href="#sheet.Sheet.row_len-method"><b>row_len</b></a>(row_index).
  1643. </p></dd>
  1644. <dt><a id='sheet.Sheet.nrows-attribute' name='sheet.Sheet.nrows-attribute'><b>nrows</b></a> [<a href='#sheet.Sheet.nrows-attribute'>#</a>]</dt>
  1645. <dd>
  1646. <p>Number of rows in sheet. A row index is in range(thesheet.nrows).</p>
  1647. </dd>
  1648. <dt><a id='sheet.Sheet.rich_text_runlist_map-attribute' name='sheet.Sheet.rich_text_runlist_map-attribute'><b>rich_text_runlist_map</b></a> [<a href='#sheet.Sheet.rich_text_runlist_map-attribute'>#</a>]</dt>
  1649. <dd>
  1650. <p>Mapping of (rowx, colx) to list of (offset, font_index) tuples. The offset
  1651. defines where in the string the font begins to be used.
  1652. Offsets are expected to be in ascending order.
  1653. If the first offset is not zero, the meaning is that the cell's XF's font should
  1654. be used from offset 0.
  1655. <br /> This is a sparse mapping. There is no entry for cells that are not formatted with
  1656. rich text.
  1657. <br />How to use:
  1658. <pre>
  1659. runlist = thesheet.rich_text_runlist_map.get((rowx, colx))
  1660. if runlist:
  1661. for offset, font_index in runlist:
  1662. # do work here.
  1663. pass
  1664. </pre>
  1665. Populated only if open_workbook(formatting_info=True).
  1666. <br /> -- New in version 0.7.2.
  1667. <br /> &#160;
  1668. </p></dd>
  1669. <dt><a id='sheet.Sheet.row-method' name='sheet.Sheet.row-method'><b>row(rowx)</b></a> [<a href='#sheet.Sheet.row-method'>#</a>]</dt>
  1670. <dd>
  1671. <p>Returns a sequence of the <a class="link" href="#sheet.Cell-class"><b>Cell</b></a> objects in the given row.
  1672. </p></dd>
  1673. <dt><a id='sheet.Sheet.row_label_ranges-attribute' name='sheet.Sheet.row_label_ranges-attribute'><b>row_label_ranges</b></a> [<a href='#sheet.Sheet.row_label_ranges-attribute'>#</a>]</dt>
  1674. <dd>
  1675. <p>List of address ranges of cells containing row labels.
  1676. For more details, see <i>col_label_ranges</i> above.
  1677. <br /> -- New in version 0.6.0
  1678. </p></dd>
  1679. <dt><a id='sheet.Sheet.row_len-method' name='sheet.Sheet.row_len-method'><b>row_len(rowx)</b></a> [<a href='#sheet.Sheet.row_len-method'>#</a>]</dt>
  1680. <dd>
  1681. <p>Returns the effective number of cells in the given row. For use with
  1682. open_workbook(ragged_rows=True) which is likely to produce rows
  1683. with fewer than <a class="link" href="#sheet.Sheet.ncols-variable"><b>ncols</b></a> cells.
  1684. <br /> -- New in version 0.7.2
  1685. </p></dd>
  1686. <dt><a id='sheet.Sheet.row_slice-method' name='sheet.Sheet.row_slice-method'><b>row_slice(rowx, start_colx=0, end_colx=None)</b></a> [<a href='#sheet.Sheet.row_slice-method'>#</a>]</dt>
  1687. <dd>
  1688. <p>Returns a slice of the <a class="link" href="#sheet.Cell-class"><b>Cell</b></a> objects in the given row.
  1689. </p></dd>
  1690. <dt><a id='sheet.Sheet.row_types-method' name='sheet.Sheet.row_types-method'><b>row_types(rowx, start_colx=0, end_colx=None)</b></a> [<a href='#sheet.Sheet.row_types-method'>#</a>]</dt>
  1691. <dd>
  1692. <p>Returns a slice of the types
  1693. of the cells in the given row.</p>
  1694. </dd>
  1695. <dt><a id='sheet.Sheet.row_values-method' name='sheet.Sheet.row_values-method'><b>row_values(rowx, start_colx=0, end_colx=None)</b></a> [<a href='#sheet.Sheet.row_values-method'>#</a>]</dt>
  1696. <dd>
  1697. <p>Returns a slice of the values
  1698. of the cells in the given row.</p>
  1699. </dd>
  1700. <dt><a id='sheet.Sheet.rowinfo_map-attribute' name='sheet.Sheet.rowinfo_map-attribute'><b>rowinfo_map</b></a> [<a href='#sheet.Sheet.rowinfo_map-attribute'>#</a>]</dt>
  1701. <dd>
  1702. <p>The map from a row index to a <a class="link" href="#sheet.Rowinfo-class"><b>Rowinfo</b></a> object. Note that it is possible
  1703. to have missing entries -- at least one source of XLS files doesn't
  1704. bother writing ROW records.
  1705. <br /> -- New in version 0.6.1. Populated only if open_workbook(formatting_info=True).
  1706. </p></dd>
  1707. <dt><a id='sheet.Sheet.split_active_pane-attribute' name='sheet.Sheet.split_active_pane-attribute'><b>split_active_pane</b></a> [<a href='#sheet.Sheet.split_active_pane-attribute'>#</a>]</dt>
  1708. <dd>
  1709. <p>Frozen panes: ignore it. Split panes: explanation and diagrams in OOo docs.</p>
  1710. </dd>
  1711. <dt><a id='sheet.Sheet.standardwidth-attribute' name='sheet.Sheet.standardwidth-attribute'><b>standardwidth</b></a> [<a href='#sheet.Sheet.standardwidth-attribute'>#</a>]</dt>
  1712. <dd>
  1713. <p>Default column width from STANDARDWIDTH record, else None.
  1714. From the OOo docs:<br />
  1715. """Default width of the columns in 1/256 of the width of the zero
  1716. character, using default font (first FONT record in the file)."""<br />
  1717. For the default hierarchy, refer to the <a class="link" href="#sheet.Colinfo-class"><b>Colinfo</b></a> class.
  1718. <br /> -- New in version 0.6.1
  1719. </p></dd>
  1720. <dt><a id='sheet.Sheet.vert_split_first_visible-attribute' name='sheet.Sheet.vert_split_first_visible-attribute'><b>vert_split_first_visible</b></a> [<a href='#sheet.Sheet.vert_split_first_visible-attribute'>#</a>]</dt>
  1721. <dd>
  1722. <p>Index of first visible column in right frozen/split pane</p>
  1723. </dd>
  1724. <dt><a id='sheet.Sheet.vert_split_pos-attribute' name='sheet.Sheet.vert_split_pos-attribute'><b>vert_split_pos</b></a> [<a href='#sheet.Sheet.vert_split_pos-attribute'>#</a>]</dt>
  1725. <dd>
  1726. <p>Number of columns in left pane (frozen panes; for split panes, see comments below in code)</p>
  1727. </dd>
  1728. <dt><a id='sheet.Sheet.vertical_page_breaks-attribute' name='sheet.Sheet.vertical_page_breaks-attribute'><b>vertical_page_breaks</b></a> [<a href='#sheet.Sheet.vertical_page_breaks-attribute'>#</a>]</dt>
  1729. <dd>
  1730. <p>A list of the vertical page breaks in this sheet.
  1731. Breaks are tuples in the form (index of col after break, start row index, end row index).
  1732. Populated only if open_workbook(formatting_info=True).
  1733. <br /> -- New in version 0.7.2
  1734. </p></dd>
  1735. <dt><a id='sheet.Sheet.visibility-attribute' name='sheet.Sheet.visibility-attribute'><b>visibility</b></a> [<a href='#sheet.Sheet.visibility-attribute'>#</a>]</dt>
  1736. <dd>
  1737. <p>Visibility of the sheet. 0 = visible, 1 = hidden (can be unhidden
  1738. by user -- Format/Sheet/Unhide), 2 = &quot;very hidden&quot; (can be unhidden
  1739. only by VBA macro).</p>
  1740. </dd>
  1741. </dl>
  1742. <h2><a id='formatting.XF-class' name='formatting.XF-class'>The XF Class</a></h2>
  1743. <dl>
  1744. <dt><b>XF</b> (class) [<a href='#formatting.XF-class'>#</a>]</dt>
  1745. <dd>
  1746. <p>eXtended Formatting information for cells, rows, columns and styles.
  1747. <br /> -- New in version 0.6.1
  1748. </p><p>Each of the 6 flags below describes the validity of
  1749. a specific group of attributes.
  1750. <br />
  1751. In cell XFs, flag==0 means the attributes of the parent style XF are used,
  1752. (but only if the attributes are valid there); flag==1 means the attributes
  1753. of this XF are used.<br />
  1754. In style XFs, flag==0 means the attribute setting is valid; flag==1 means
  1755. the attribute should be ignored.<br />
  1756. Note that the API
  1757. provides both "raw" XFs and "computed" XFs -- in the latter case, cell XFs
  1758. have had the above inheritance mechanism applied.
  1759. </p>
  1760. </dd>
  1761. <dt><a id='formatting.XF._alignment_flag-attribute' name='formatting.XF._alignment_flag-attribute'><b>_alignment_flag</b></a> [<a href='#formatting.XF._alignment_flag-attribute'>#</a>]</dt>
  1762. <dd>
  1763. </dd>
  1764. <dt><a id='formatting.XF._background_flag-attribute' name='formatting.XF._background_flag-attribute'><b>_background_flag</b></a> [<a href='#formatting.XF._background_flag-attribute'>#</a>]</dt>
  1765. <dd>
  1766. </dd>
  1767. <dt><a id='formatting.XF._border_flag-attribute' name='formatting.XF._border_flag-attribute'><b>_border_flag</b></a> [<a href='#formatting.XF._border_flag-attribute'>#</a>]</dt>
  1768. <dd>
  1769. </dd>
  1770. <dt><a id='formatting.XF._font_flag-attribute' name='formatting.XF._font_flag-attribute'><b>_font_flag</b></a> [<a href='#formatting.XF._font_flag-attribute'>#</a>]</dt>
  1771. <dd>
  1772. </dd>
  1773. <dt><a id='formatting.XF._format_flag-attribute' name='formatting.XF._format_flag-attribute'><b>_format_flag</b></a> [<a href='#formatting.XF._format_flag-attribute'>#</a>]</dt>
  1774. <dd>
  1775. </dd>
  1776. <dt><a id='formatting.XF._protection_flag-attribute' name='formatting.XF._protection_flag-attribute'><b>_protection_flag</b></a> [<a href='#formatting.XF._protection_flag-attribute'>#</a>]</dt>
  1777. <dd>
  1778. <p>&#160;
  1779. </p></dd>
  1780. <dt><a id='formatting.XF.alignment-attribute' name='formatting.XF.alignment-attribute'><b>alignment</b></a> [<a href='#formatting.XF.alignment-attribute'>#</a>]</dt>
  1781. <dd>
  1782. <p>An instance of an XFAlignment object.</p>
  1783. </dd>
  1784. <dt><a id='formatting.XF.background-attribute' name='formatting.XF.background-attribute'><b>background</b></a> [<a href='#formatting.XF.background-attribute'>#</a>]</dt>
  1785. <dd>
  1786. <p>An instance of an XFBackground object.</p>
  1787. </dd>
  1788. <dt><a id='formatting.XF.border-attribute' name='formatting.XF.border-attribute'><b>border</b></a> [<a href='#formatting.XF.border-attribute'>#</a>]</dt>
  1789. <dd>
  1790. <p>An instance of an XFBorder object.</p>
  1791. </dd>
  1792. <dt><a id='formatting.XF.font_index-attribute' name='formatting.XF.font_index-attribute'><b>font_index</b></a> [<a href='#formatting.XF.font_index-attribute'>#</a>]</dt>
  1793. <dd>
  1794. <p>Index into Book.font_list</p>
  1795. </dd>
  1796. <dt><a id='formatting.XF.format_key-attribute' name='formatting.XF.format_key-attribute'><b>format_key</b></a> [<a href='#formatting.XF.format_key-attribute'>#</a>]</dt>
  1797. <dd>
  1798. <p>Key into Book.format_map
  1799. </p><p>
  1800. Warning: OOo docs on the XF record call this "Index to FORMAT record".
  1801. It is not an index in the Python sense. It is a key to a map.
  1802. It is true <i>only</i> for Excel 4.0 and earlier files
  1803. that the key into format_map from an XF instance
  1804. is the same as the index into format_list, and <i>only</i>
  1805. if the index is less than 164.
  1806. </p>
  1807. </dd>
  1808. <dt><a id='formatting.XF.is_style-attribute' name='formatting.XF.is_style-attribute'><b>is_style</b></a> [<a href='#formatting.XF.is_style-attribute'>#</a>]</dt>
  1809. <dd>
  1810. <p>0 = cell XF, 1 = style XF</p>
  1811. </dd>
  1812. <dt><a id='formatting.XF.parent_style_index-attribute' name='formatting.XF.parent_style_index-attribute'><b>parent_style_index</b></a> [<a href='#formatting.XF.parent_style_index-attribute'>#</a>]</dt>
  1813. <dd>
  1814. <p>cell XF: Index into Book.xf_list
  1815. of this XF's style XF<br />
  1816. style XF: 0xFFF
  1817. </p></dd>
  1818. <dt><a id='formatting.XF.protection-attribute' name='formatting.XF.protection-attribute'><b>protection</b></a> [<a href='#formatting.XF.protection-attribute'>#</a>]</dt>
  1819. <dd>
  1820. <p>An instance of an XFProtection object.</p>
  1821. </dd>
  1822. <dt><a id='formatting.XF.xf_index-attribute' name='formatting.XF.xf_index-attribute'><b>xf_index</b></a> [<a href='#formatting.XF.xf_index-attribute'>#</a>]</dt>
  1823. <dd>
  1824. <p>Index into Book.xf_list</p>
  1825. </dd>
  1826. </dl>
  1827. <h2><a id='formatting.XFAlignment-class' name='formatting.XFAlignment-class'>The XFAlignment Class</a></h2>
  1828. <dl>
  1829. <dt><b>XFAlignment</b> (class) [<a href='#formatting.XFAlignment-class'>#</a>]</dt>
  1830. <dd>
  1831. <p>A collection of the alignment and similar attributes of an XF record.
  1832. Items correspond to those in the Excel UI's Format/Cells/Alignment tab.
  1833. <br /> -- New in version 0.6.1
  1834. </p></dd>
  1835. <dt><a id='formatting.XFAlignment.hor_align-attribute' name='formatting.XFAlignment.hor_align-attribute'><b>hor_align</b></a> [<a href='#formatting.XFAlignment.hor_align-attribute'>#</a>]</dt>
  1836. <dd>
  1837. <p>Values: section 6.115 (p 214) of OOo docs</p>
  1838. </dd>
  1839. <dt><a id='formatting.XFAlignment.indent_level-attribute' name='formatting.XFAlignment.indent_level-attribute'><b>indent_level</b></a> [<a href='#formatting.XFAlignment.indent_level-attribute'>#</a>]</dt>
  1840. <dd>
  1841. <p>A number in range(15).</p>
  1842. </dd>
  1843. <dt><a id='formatting.XFAlignment.rotation-attribute' name='formatting.XFAlignment.rotation-attribute'><b>rotation</b></a> [<a href='#formatting.XFAlignment.rotation-attribute'>#</a>]</dt>
  1844. <dd>
  1845. <p>Values: section 6.115 (p 215) of OOo docs.<br />
  1846. Note: file versions BIFF7 and earlier use the documented
  1847. "orientation" attribute; this will be mapped (without loss)
  1848. into "rotation".
  1849. </p></dd>
  1850. <dt><a id='formatting.XFAlignment.shrink_to_fit-attribute' name='formatting.XFAlignment.shrink_to_fit-attribute'><b>shrink_to_fit</b></a> [<a href='#formatting.XFAlignment.shrink_to_fit-attribute'>#</a>]</dt>
  1851. <dd>
  1852. <p>1 = shrink font size to fit text into cell.</p>
  1853. </dd>
  1854. <dt><a id='formatting.XFAlignment.text_direction-attribute' name='formatting.XFAlignment.text_direction-attribute'><b>text_direction</b></a> [<a href='#formatting.XFAlignment.text_direction-attribute'>#</a>]</dt>
  1855. <dd>
  1856. <p>0 = according to context; 1 = left-to-right; 2 = right-to-left</p>
  1857. </dd>
  1858. <dt><a id='formatting.XFAlignment.text_wrapped-attribute' name='formatting.XFAlignment.text_wrapped-attribute'><b>text_wrapped</b></a> [<a href='#formatting.XFAlignment.text_wrapped-attribute'>#</a>]</dt>
  1859. <dd>
  1860. <p>1 = text is wrapped at right margin</p>
  1861. </dd>
  1862. <dt><a id='formatting.XFAlignment.vert_align-attribute' name='formatting.XFAlignment.vert_align-attribute'><b>vert_align</b></a> [<a href='#formatting.XFAlignment.vert_align-attribute'>#</a>]</dt>
  1863. <dd>
  1864. <p>Values: section 6.115 (p 215) of OOo docs</p>
  1865. </dd>
  1866. </dl>
  1867. <h2><a id='formatting.XFBackground-class' name='formatting.XFBackground-class'>The XFBackground Class</a></h2>
  1868. <dl>
  1869. <dt><b>XFBackground</b> (class) [<a href='#formatting.XFBackground-class'>#</a>]</dt>
  1870. <dd>
  1871. <p>A collection of the background-related attributes of an XF record.
  1872. Items correspond to those in the Excel UI's Format/Cells/Patterns tab.
  1873. An explanation of "colour index" is given in the Formatting
  1874. section at the start of this document.
  1875. <br /> -- New in version 0.6.1
  1876. </p></dd>
  1877. <dt><a id='formatting.XFBackground.background_colour_index-attribute' name='formatting.XFBackground.background_colour_index-attribute'><b>background_colour_index</b></a> [<a href='#formatting.XFBackground.background_colour_index-attribute'>#</a>]</dt>
  1878. <dd>
  1879. <p>See section 3.11 of the OOo docs.</p>
  1880. </dd>
  1881. <dt><a id='formatting.XFBackground.fill_pattern-attribute' name='formatting.XFBackground.fill_pattern-attribute'><b>fill_pattern</b></a> [<a href='#formatting.XFBackground.fill_pattern-attribute'>#</a>]</dt>
  1882. <dd>
  1883. <p>See section 3.11 of the OOo docs.</p>
  1884. </dd>
  1885. <dt><a id='formatting.XFBackground.pattern_colour_index-attribute' name='formatting.XFBackground.pattern_colour_index-attribute'><b>pattern_colour_index</b></a> [<a href='#formatting.XFBackground.pattern_colour_index-attribute'>#</a>]</dt>
  1886. <dd>
  1887. <p>See section 3.11 of the OOo docs.</p>
  1888. </dd>
  1889. </dl>
  1890. <h2><a id='formatting.XFBorder-class' name='formatting.XFBorder-class'>The XFBorder Class</a></h2>
  1891. <dl>
  1892. <dt><b>XFBorder</b> (class) [<a href='#formatting.XFBorder-class'>#</a>]</dt>
  1893. <dd>
  1894. <p /><p>A collection of the border-related attributes of an XF record.
  1895. Items correspond to those in the Excel UI's Format/Cells/Border tab.</p>
  1896. <p> An explanations of &quot;colour index&quot; is given in the Formatting
  1897. section at the start of this document.
  1898. There are five line style attributes; possible values and the
  1899. associated meanings are:
  1900. 0&#160;=&#160;No line,
  1901. 1&#160;=&#160;Thin,
  1902. 2&#160;=&#160;Medium,
  1903. 3&#160;=&#160;Dashed,
  1904. 4&#160;=&#160;Dotted,
  1905. 5&#160;=&#160;Thick,
  1906. 6&#160;=&#160;Double,
  1907. 7&#160;=&#160;Hair,
  1908. 8&#160;=&#160;Medium dashed,
  1909. 9&#160;=&#160;Thin dash-dotted,
  1910. 10&#160;=&#160;Medium dash-dotted,
  1911. 11&#160;=&#160;Thin dash-dot-dotted,
  1912. 12&#160;=&#160;Medium dash-dot-dotted,
  1913. 13&#160;=&#160;Slanted medium dash-dotted.
  1914. The line styles 8 to 13 appear in BIFF8 files (Excel 97 and later) only.
  1915. For pictures of the line styles, refer to OOo docs s3.10 (p22)
  1916. &quot;Line Styles for Cell Borders (BIFF3-BIFF8)&quot;.</p>
  1917. <br /> -- New in version 0.6.1
  1918. </dd>
  1919. <dt><a id='formatting.XFBorder.bottom_colour_index-attribute' name='formatting.XFBorder.bottom_colour_index-attribute'><b>bottom_colour_index</b></a> [<a href='#formatting.XFBorder.bottom_colour_index-attribute'>#</a>]</dt>
  1920. <dd>
  1921. <p>The colour index for the cell's bottom line</p>
  1922. </dd>
  1923. <dt><a id='formatting.XFBorder.bottom_line_style-attribute' name='formatting.XFBorder.bottom_line_style-attribute'><b>bottom_line_style</b></a> [<a href='#formatting.XFBorder.bottom_line_style-attribute'>#</a>]</dt>
  1924. <dd>
  1925. <p>The line style for the cell's bottom line</p>
  1926. </dd>
  1927. <dt><a id='formatting.XFBorder.diag_colour_index-attribute' name='formatting.XFBorder.diag_colour_index-attribute'><b>diag_colour_index</b></a> [<a href='#formatting.XFBorder.diag_colour_index-attribute'>#</a>]</dt>
  1928. <dd>
  1929. <p>The colour index for the cell's diagonal lines, if any</p>
  1930. </dd>
  1931. <dt><a id='formatting.XFBorder.diag_down-attribute' name='formatting.XFBorder.diag_down-attribute'><b>diag_down</b></a> [<a href='#formatting.XFBorder.diag_down-attribute'>#</a>]</dt>
  1932. <dd>
  1933. <p>1 = draw a diagonal from top left to bottom right</p>
  1934. </dd>
  1935. <dt><a id='formatting.XFBorder.diag_line_style-attribute' name='formatting.XFBorder.diag_line_style-attribute'><b>diag_line_style</b></a> [<a href='#formatting.XFBorder.diag_line_style-attribute'>#</a>]</dt>
  1936. <dd>
  1937. <p>The line style for the cell's diagonal lines, if any</p>
  1938. </dd>
  1939. <dt><a id='formatting.XFBorder.diag_up-attribute' name='formatting.XFBorder.diag_up-attribute'><b>diag_up</b></a> [<a href='#formatting.XFBorder.diag_up-attribute'>#</a>]</dt>
  1940. <dd>
  1941. <p>1 = draw a diagonal from bottom left to top right</p>
  1942. </dd>
  1943. <dt><a id='formatting.XFBorder.left_colour_index-attribute' name='formatting.XFBorder.left_colour_index-attribute'><b>left_colour_index</b></a> [<a href='#formatting.XFBorder.left_colour_index-attribute'>#</a>]</dt>
  1944. <dd>
  1945. <p>The colour index for the cell's left line</p>
  1946. </dd>
  1947. <dt><a id='formatting.XFBorder.left_line_style-attribute' name='formatting.XFBorder.left_line_style-attribute'><b>left_line_style</b></a> [<a href='#formatting.XFBorder.left_line_style-attribute'>#</a>]</dt>
  1948. <dd>
  1949. <p>The line style for the cell's left line</p>
  1950. </dd>
  1951. <dt><a id='formatting.XFBorder.right_colour_index-attribute' name='formatting.XFBorder.right_colour_index-attribute'><b>right_colour_index</b></a> [<a href='#formatting.XFBorder.right_colour_index-attribute'>#</a>]</dt>
  1952. <dd>
  1953. <p>The colour index for the cell's right line</p>
  1954. </dd>
  1955. <dt><a id='formatting.XFBorder.right_line_style-attribute' name='formatting.XFBorder.right_line_style-attribute'><b>right_line_style</b></a> [<a href='#formatting.XFBorder.right_line_style-attribute'>#</a>]</dt>
  1956. <dd>
  1957. <p>The line style for the cell's right line</p>
  1958. </dd>
  1959. <dt><a id='formatting.XFBorder.top_colour_index-attribute' name='formatting.XFBorder.top_colour_index-attribute'><b>top_colour_index</b></a> [<a href='#formatting.XFBorder.top_colour_index-attribute'>#</a>]</dt>
  1960. <dd>
  1961. <p>The colour index for the cell's top line</p>
  1962. </dd>
  1963. <dt><a id='formatting.XFBorder.top_line_style-attribute' name='formatting.XFBorder.top_line_style-attribute'><b>top_line_style</b></a> [<a href='#formatting.XFBorder.top_line_style-attribute'>#</a>]</dt>
  1964. <dd>
  1965. <p>The line style for the cell's top line</p>
  1966. </dd>
  1967. </dl>
  1968. <h2><a id='formatting.XFProtection-class' name='formatting.XFProtection-class'>The XFProtection Class</a></h2>
  1969. <dl>
  1970. <dt><b>XFProtection</b> (class) [<a href='#formatting.XFProtection-class'>#</a>]</dt>
  1971. <dd>
  1972. <p>A collection of the protection-related attributes of an XF record.
  1973. Items correspond to those in the Excel UI's Format/Cells/Protection tab.
  1974. Note the OOo docs include the "cell or style" bit
  1975. in this bundle of attributes.
  1976. This is incorrect; the bit is used in determining which bundles to use.
  1977. <br /> -- New in version 0.6.1
  1978. </p></dd>
  1979. <dt><a id='formatting.XFProtection.cell_locked-attribute' name='formatting.XFProtection.cell_locked-attribute'><b>cell_locked</b></a> [<a href='#formatting.XFProtection.cell_locked-attribute'>#</a>]</dt>
  1980. <dd>
  1981. <p>1 = Cell is prevented from being changed, moved, resized, or deleted
  1982. (only if the sheet is protected).</p>
  1983. </dd>
  1984. <dt><a id='formatting.XFProtection.formula_hidden-attribute' name='formatting.XFProtection.formula_hidden-attribute'><b>formula_hidden</b></a> [<a href='#formatting.XFProtection.formula_hidden-attribute'>#</a>]</dt>
  1985. <dd>
  1986. <p>1 = Hide formula so that it doesn't appear in the formula bar when
  1987. the cell is selected (only if the sheet is protected).</p>
  1988. </dd>
  1989. </dl>
  1990. </body></html>