Skip to main content

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

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"])

Metadata

Release files for pandas-ods-reader 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pandas-ods-reader 1.0.2
File Size Uploaded
pandas_ods_reader-1.0.2.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pandas-ods-reader 1.0.2
File Interpreter ABI Platform
pandas_ods_reader-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 12.7 kB

Release files / pandas_ods_reader-1.0.2.tar.gz

Download URL pandas_ods_reader-1.0.2.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
dc414120e28e72a509b163d6d10a04d06e2ce343095fa1adf8e4a6606f383ec4
BLAKE2b-256 checksum
How to use checksums
e0de14e25051b1c60690f1400b40519ccee5c16b8f868e3be7185d40637b1f9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.12.7 Linux/6.12.25_1

Release files / pandas_ods_reader-1.0.2-py3-none-any.whl

Download URL pandas_ods_reader-1.0.2-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e2e4a58ddb423b3c4ae64880edbf5ae72ea5f2ffffadfaf4af76dd182774a08
BLAKE2b-256 checksum
How to use checksums
85d95474a94729a9f0c3e6f020cbfdf919624f6c329992ef871b6f2289d3a902
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.12.7 Linux/6.12.25_1

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page