
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
.. contents:: excelrd :backlinks: top :depth: 2
.. image:: https://badge.fury.io/py/excelrd.svg :target: https://badge.fury.io/py/excelrd :alt: PyPI package version
.. image:: https://img.shields.io/pypi/pyversions/excelrd.svg :target: https://pypi.org/project/excelrd :alt: Supported Python versions
.. image:: https://img.shields.io/pypi/implementation/excelrd.svg :target: https://pypi.org/project/excelrd :alt: Supported Python implementations
.. image:: https://github.com/thombashi/excelrd/actions/workflows/ci.yml/badge.svg :target: https://github.com/thombashi/excelrd/actions/workflows/ci.yml :alt: CI status of Linux/macOS/Windows
.. image:: https://coveralls.io/repos/github/thombashi/excelrd/badge.svg?branch=master :target: https://coveralls.io/github/thombashi/excelrd?branch=master :alt: Test coverage
excelrd
is a modified version of xlrd <http://www.python-excel.org/>
__ to work for the latest Python versions.
xlrd
will not work in Python 3.9 or newer versions.
Purpose: Provide a library for developers to use to extract data from Microsoft Excel (tm) spreadsheet files. It is not an end-user tool.
Author: John Machin
Licence: BSD-style (see licences.py)
Versions of Python supported: 3.5+.
Outside scope: excelrd will safely and reliably ignore any of these if present in the file:
::
pip install excelrd
Print all of the cell values in a specific sheet:
:Sample Code: .. code:: python
import excelrd
def main():
book = excelrd.open_workbook("namesdemo.xls")
print("The number of worksheets is {}".format(book.nsheets))
print("Worksheet name(s): {}".format(", ".join(book.sheet_names())))
sh = book.sheet_by_index(2)
print("{}: rows={}, cols={}".format(sh.name, sh.nrows, sh.ncols))
for row_idx in range(sh.nrows):
for col_idx in range(sh.ncols):
cell = sh.cell(row_idx, col_idx)
if not cell.value:
continue
print("row={}, col={}, value={}".format(row_idx, col_idx, cell.value))
Replace the import from import xlrd
to import excelrd
:
.. code:: python
import excelrd as xlrd
This will show the first, second and last rows of each sheet in each file:
::
python PYDIR/scripts/runxlrd.py 3rows *blah*.xls
FAQs
Library for developers to extract data from Microsoft Excel (tm) spreadsheet files
We found that excelrd demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.