Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/python-excel/xlrd
Please use openpyxl where you can...
https://github.com/python-excel/xlrd
Last synced: 4 days ago
JSON representation
Please use openpyxl where you can...
- Host: GitHub
- URL: https://github.com/python-excel/xlrd
- Owner: python-excel
- License: other
- Created: 2012-03-07T04:50:48.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2024-07-08T18:29:05.000Z (7 months ago)
- Last Synced: 2025-01-15T06:40:35.533Z (11 days ago)
- Language: Python
- Homepage: http://www.python-excel.org/
- Size: 3.39 MB
- Stars: 2,165
- Watchers: 96
- Forks: 434
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-quant - xlrd - Library for developers to extract data from Microsoft Excel spreadsheet files. (Python / Excel Integration)
- awesome-quant - xlrd - Library for developers to extract data from Microsoft Excel spreadsheet files. (Python / Excel Integration)
- starred-awesome - xlrd - Library for developers to extract data from Microsoft Excel (tm) spreadsheet files (Python)
- awesome-python-machine-learning-resources - GitHub
README
xlrd
====|Build Status|_ |Coverage Status|_ |Documentation|_ |PyPI version|_
.. |Build Status| image:: https://circleci.com/gh/python-excel/xlrd/tree/master.svg?style=shield
.. _Build Status: https://circleci.com/gh/python-excel/xlrd/tree/master.. |Coverage Status| image:: https://codecov.io/gh/python-excel/xlrd/branch/master/graph/badge.svg?token=lNSqwBBbvk
.. _Coverage Status: https://codecov.io/gh/python-excel/xlrd.. |Documentation| image:: https://readthedocs.org/projects/xlrd/badge/?version=latest
.. _Documentation: http://xlrd.readthedocs.io/en/latest/?badge=latest.. |PyPI version| image:: https://badge.fury.io/py/xlrd.svg
.. _PyPI version: https://badge.fury.io/py/xlrdxlrd is a library for reading data and formatting information from Excel
files in the historical ``.xls`` format... warning::
This library will no longer read anything other than ``.xls`` files. For
alternatives that read newer file formats, please see http://www.python-excel.org/.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 validationPassword-protected files are not supported and cannot be read by this library.
Quick start:
.. code-block:: bash
pip install xlrd
.. code-block:: pythonimport 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:
.. code-block:: bash
python PYDIR/scripts/runxlrd.py 3rows *blah*.xls