pandas-ods-reader


Namepandas-ods-reader JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/iuvbio/pandas_ods_reader
SummaryRead in .ods and .fods files and return a pandas.DataFrame.
upload_time2024-05-31 21:48:28
maintainerNone
docs_urlNone
authoriuvbio
requires_python<3.13,>=3.9
licenseMIT
keywords data io pandas ods
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            pandas-ods-reader
===

Provides a function to read in a **.ods** or **.fods** file and returns a pandas DataFrame.

It uses `ezodf` to read in **.ods** files. Since **.fods** files are essentially xml, `lxml` is used to read them. The correct parser is automatically chosen based on the file's extension.

If a range is specified in the sheet to be imported, it seems that `ezodf` imports empty cells as well. Therefore, completely empty rows and columns are dropped from the DataFrame, before it is returned. Only trailing empty rows and columns are dropped.

If the ODS file contains duplicated column names, they will be numbered and the number is appended to the column name in the resulting DataFrame.

Dependencies
---

-   `ezodf`
-   `lxml`
-   `pandas`

Installation
---

`pip install pandas-ods-reader`

Usage
---

```Python
from pandas_ods_reader import read_ods

path = "path/to/file.ods"

# by default the first sheet is imported
df = read_ods(path)

# load a sheet based on its index (1 based)
sheet_idx = 2
df = read_ods(path, sheet_idx)

# load a sheet based on its name
sheet_name = "sheet1"
df = read_ods(path, sheet_name)

# load a file that does not contain a header row
# if no columns are provided, they will be numbered
df = read_ods(path, 1, headers=False)

# load a file and provide custom column names
# if headers is True (the default), the header row will be overwritten
df = read_ods(path, 1, columns=["A", "B", "C"])
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/iuvbio/pandas_ods_reader",
    "name": "pandas-ods-reader",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.9",
    "maintainer_email": null,
    "keywords": "data, io, pandas, ods",
    "author": "iuvbio",
    "author_email": "iuvbio@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/fd/43/2574e56daf5d876ebb9c719257dc2459eeaeea4dfa293cdf944eaf2b1faa/pandas_ods_reader-1.0.1.tar.gz",
    "platform": null,
    "description": "pandas-ods-reader\n===\n\nProvides a function to read in a **.ods** or **.fods** file and returns a pandas DataFrame.\n\nIt uses `ezodf` to read in **.ods** files. Since **.fods** files are essentially xml, `lxml` is used to read them. The correct parser is automatically chosen based on the file's extension.\n\nIf a range is specified in the sheet to be imported, it seems that `ezodf` imports empty cells as well. Therefore, completely empty rows and columns are dropped from the DataFrame, before it is returned. Only trailing empty rows and columns are dropped.\n\nIf the ODS file contains duplicated column names, they will be numbered and the number is appended to the column name in the resulting DataFrame.\n\nDependencies\n---\n\n-   `ezodf`\n-   `lxml`\n-   `pandas`\n\nInstallation\n---\n\n`pip install pandas-ods-reader`\n\nUsage\n---\n\n```Python\nfrom pandas_ods_reader import read_ods\n\npath = \"path/to/file.ods\"\n\n# by default the first sheet is imported\ndf = read_ods(path)\n\n# load a sheet based on its index (1 based)\nsheet_idx = 2\ndf = read_ods(path, sheet_idx)\n\n# load a sheet based on its name\nsheet_name = \"sheet1\"\ndf = read_ods(path, sheet_name)\n\n# load a file that does not contain a header row\n# if no columns are provided, they will be numbered\ndf = read_ods(path, 1, headers=False)\n\n# load a file and provide custom column names\n# if headers is True (the default), the header row will be overwritten\ndf = read_ods(path, 1, columns=[\"A\", \"B\", \"C\"])\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Read in .ods and .fods files and return a pandas.DataFrame.",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/iuvbio/pandas_ods_reader",
        "Repository": "https://github.com/iuvbio/pandas_ods_reader"
    },
    "split_keywords": [
        "data",
        " io",
        " pandas",
        " ods"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "60ffea0aeab80318033bc6717271f17007b76a0216d6aa2c8d95386b4fd36c9f",
                "md5": "c9100b8d4446a227175dbbf2551d6f8b",
                "sha256": "35a254ec95665fb654b573d7131787bf177e9126b06746ea3c17b1b972abc79b"
            },
            "downloads": -1,
            "filename": "pandas_ods_reader-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c9100b8d4446a227175dbbf2551d6f8b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.9",
            "size": 7295,
            "upload_time": "2024-05-31T21:48:26",
            "upload_time_iso_8601": "2024-05-31T21:48:26.557055Z",
            "url": "https://files.pythonhosted.org/packages/60/ff/ea0aeab80318033bc6717271f17007b76a0216d6aa2c8d95386b4fd36c9f/pandas_ods_reader-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fd432574e56daf5d876ebb9c719257dc2459eeaeea4dfa293cdf944eaf2b1faa",
                "md5": "c11029c80d7eecf27ea897dbab122400",
                "sha256": "e87806d72bba31845de9f0dfa6c5621a5aa9b120cb84049544fee0e8baad8f9c"
            },
            "downloads": -1,
            "filename": "pandas_ods_reader-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c11029c80d7eecf27ea897dbab122400",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.9",
            "size": 5534,
            "upload_time": "2024-05-31T21:48:28",
            "upload_time_iso_8601": "2024-05-31T21:48:28.219167Z",
            "url": "https://files.pythonhosted.org/packages/fd/43/2574e56daf5d876ebb9c719257dc2459eeaeea4dfa293cdf944eaf2b1faa/pandas_ods_reader-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-31 21:48:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "iuvbio",
    "github_project": "pandas_ods_reader",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pandas-ods-reader"
}
        
Elapsed time: 0.26834s