Skip to content

Update documentation on pd.read_excel, to reflect the fact that support for OpenDocument files is available #28231

@marcelonp

Description

@marcelonp
class ExcelFile:
    """
    Class for parsing tabular excel sheets into DataFrame objects.
    Uses xlrd. See read_excel for more documentation

    Parameters
    ----------
    io : string, path object (pathlib.Path or py._path.local.LocalPath),
        file-like object or xlrd workbook
        If a string or path object, expected to be a path to xls or xlsx file.
    engine : string, default None
        If io is not a buffer or path, this must be set to identify io.
        Acceptable values are None or ``xlrd``.
    """

    from pandas.io.excel._odfreader import _ODFReader
    from pandas.io.excel._openpyxl import _OpenpyxlReader
    from pandas.io.excel._xlrd import _XlrdReader

    _engines = {"xlrd": _XlrdReader, "openpyxl": _OpenpyxlReader, "odf": _ODFReader}

Problem description

I was searching for support for reading .ods files, and upon reading the documentation for read_excel and IO related functions, I found nothing.

When I was about to search for another library, I discovered that support had already been added to the read_excel function (as of #2311), but the docs weren't updated, either in ExcelFile, or in the read_excel function, and as suggested when creating the issue https://pandas-docs.github.io/pandas-docs-travis/ also wasn't. I also didn't find any related issue regarding this.

I might be missing something, since it is my first issue, sorry about that if it's the case.

I'd suggest even something along the lines of:

    Parameters
    ----------
    io : string, path object (pathlib.Path or py._path.local.LocalPath),
        file-like object or xlrd workbook
        If a string or path object, expected to be a path to xls or xlsx file.
    engine : string, default None
        If io is not a buffer or path, this must be set to identify io.
        Acceptable values are None, ``xlrd``, ``openpyxl`` or ``odf``.
        Note that ``odf`` reads tables out of OpenDocument formatted files.
    """

for both ExcelFile and read_excel. That would make visible that support for other engines is available.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions