Library for developers to extract data from Microsoft Excel (tm) .xls spreadsheet files
Project description
xlrd is a library for reading data and formatting information from Excel files in the historical .xls format.
The following are also not supported but will safely and reliably be ignored:
Charts, Macros, Pictures, any other embedded object, including embedded worksheets.
VBA modules
Formulas, but results of formula calculations are extracted.
Comments
Hyperlinks
Autofilters, advanced filters, pivot tables, conditional formatting, data validation
Password-protected files are not supported and cannot be read by this library.
Quick start:
pip install xlrd2
import xlrd
book = xlrd.open_workbook("myfile.xls")
print("The number of worksheets is {0}".format(book.nsheets))
print("Worksheet name(s): {0}".format(book.sheet_names()))
sh = book.sheet_by_index(0)
print("{0} {1} {2}".format(sh.name, sh.nrows, sh.ncols))
print("Cell D30 is {0}".format(sh.cell_value(rowx=29, colx=3)))
for rx in range(sh.nrows):
print(sh.row(rx))
From the command line, this will show the first, second and last rows of each sheet in each file:
python PYDIR/scripts/runxlrd.py 3rows *blah*.xls
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for xlrd_2024-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a55bb1c80a4127b35a10b1f14275f1297a67055b1d55177444567132e5d7d14 |
|
MD5 | 13d653cf5a2d0acbfad26877f92fe86c |
|
BLAKE2b-256 | 6a8c46d6054f0da36a9ae15269458bb4e7af5f743f7f43546cd57371e2b6a691 |