{"name":"xlrd: A Python Library for Reading Legacy Excel .xls Files","description":"xlrd is a Python library designed for reading data and formatting information from older Microsoft Excel .xls files. It provides a robust solution for interacting with legacy spreadsheet data, offering functionalities to access worksheets, rows, and cell values. While powerful for its specific niche, users are encouraged to consider openpyxl for newer .xlsx formats.","github":"https://github.com/python-excel/xlrd","url":"https://osrepos.com/repo/python-excel-xlrd","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/python-excel-xlrd","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/python-excel-xlrd.md","json":"https://osrepos.com/repo/python-excel-xlrd.json","topics":["Python","Excel","Spreadsheet","Data Processing","Legacy Files","Data Analysis","Office Automation"],"keywords":["Python","Excel","Spreadsheet","Data Processing","Legacy Files","Data Analysis","Office Automation"],"stars":null,"summary":"xlrd is a Python library designed for reading data and formatting information from older Microsoft Excel .xls files. It provides a robust solution for interacting with legacy spreadsheet data, offering functionalities to access worksheets, rows, and cell values. While powerful for its specific niche, users are encouraged to consider openpyxl for newer .xlsx formats.","content":"## Introduction\n`xlrd` is a well-established Python library dedicated to reading data and formatting information from historical Microsoft Excel `.xls` files. With over 2200 stars and 400 forks on GitHub, it has been a go-to tool for developers needing to process legacy Excel spreadsheets. It provides a straightforward API to access workbook, sheet, row, and cell data, making it easy to extract information from these older file formats.\n\n## Installation\nGetting started with `xlrd` is simple using pip:\n\nbash\npip install xlrd\n\n\n## Examples\nHere's a quick example demonstrating how to open an `.xls` file and read its contents:\n\npython\nimport xlrd\nbook = xlrd.open_workbook(\"myfile.xls\")\nprint(\"The number of worksheets is {0}\".format(book.nsheets))\nprint(\"Worksheet name(s): {0}\".format(book.sheet_names()))\nsh = book.sheet_by_index(0)\nprint(\"{0} {1} {2}\".format(sh.name, sh.nrows, sh.ncols))\nprint(\"Cell D30 is {0}\".format(sh.cell_value(rowx=29, colx=3)))\nfor rx in range(sh.nrows):\n    print(sh.row(rx))\n\n\n## Why Use xlrd?\n`xlrd` is specifically designed for handling the `.xls` file format, which is crucial for projects dealing with older data archives or systems that still generate these legacy files. It efficiently extracts data, including results of formula calculations, though it does not process the formulas themselves.\n\n**Important Considerations:**\n*   `xlrd` **only supports `.xls` files**. It will not read `.xlsx` or other newer Excel formats.\n*   For modern Excel files (`.xlsx`), the project explicitly recommends using alternatives like `openpyxl`.\n*   Many advanced Excel features, such as charts, macros, embedded objects, VBA modules, comments, and password-protected files, are not supported and will be ignored or prevent reading.\n\nIf your workflow strictly involves legacy `.xls` files and you need a reliable Python solution for data extraction, `xlrd` remains a valuable tool.\n\n## Links\n*   **GitHub Repository:** [https://github.com/python-excel/xlrd](https://github.com/python-excel/xlrd)\n*   **Documentation:** [http://xlrd.readthedocs.io/en/latest/](http://xlrd.readthedocs.io/en/latest/)\n*   **PyPI:** [https://badge.fury.io/py/xlrd](https://badge.fury.io/py/xlrd)","metrics":{"detailViews":1,"githubClicks":0},"dates":{"published":null,"modified":"2026-08-31T00:33:49.000Z"}}