Rust MIT

python-calamine

Python binding for Rust's library for reading excel and odf file - calamine.

D

dimastbk

Dernière activité 28 sept. 2026
dimastbk/python-calamine

499

étoiles

17

forks

17

issues ouvertes

excelodspandaspythonspreadsheetxlsxlsbxlsx

Ce README est souvent en anglais.

python-calamine

PyPI - Version Conda Version Python Version from PEP 621 TOML

Python binding for beautiful Rust's library for reading excel and odf file - calamine.

Is used

Installation

Pypi:

pip install python-calamine

Conda:

conda install -c conda-forge python-calamine

Example

from python_calamine import CalamineWorkbook

workbook = CalamineWorkbook.from_path("file.xlsx")
workbook.sheet_names
# ["Sheet1", "Sheet2"]

workbook.get_sheet_by_name("Sheet1").to_python()
# [
# ["1",  "2",  "3",  "4",  "5",  "6",  "7"],
# ["1",  "2",  "3",  "4",  "5",  "6",  "7"],
# ["1",  "2",  "3",  "4",  "5",  "6",  "7"],
# ]

By default, calamine skips empty rows/cols before data. For suppress this behaviour, set skip_empty_area to False.

from python_calamine import CalamineWorkbook

workbook = CalamineWorkbook.from_path("file.xlsx").get_sheet_by_name("Sheet1").to_python(skip_empty_area=False)
# [
# [",  ",  ",  ",  ",  ",  "],
# ["1",  "2",  "3",  "4",  "5",  "6",  "7"],
# ["1",  "2",  "3",  "4",  "5",  "6",  "7"],
# ["1",  "2",  "3",  "4",  "5",  "6",  "7"],
# ]

Pandas 2.2 and above have built-in support of python-calamine.

Also, you can find additional examples in tests.

Development

You'll need rust installed.

# clone this repo or your fork
git clone git@github.com:dimastbk/python-calamine.git
cd python-calamine
# create a new virtual env
python3 -m venv env
source env/bin/activate
# install dev dependencies and install python-calamine
pip install --group dev -e .  # required pip 25.1 and above
# lint code
pre-commit run --all-files
# test code
pytest

Projets similaires

A pure Rust Excel/OpenDocument SpreadSheets file reader: rust on metal sheets

Rustdeserializerexcelopendocument-spreadsheet
Ttafia
2,4 k étoiles252

Single API for reading, manipulating and writing data in csv, ods, xls, xlsx and xlsm files

Pythoncsvexcelfods
Ppyexcel
1,3 k étoiles172

A fast excel reader for Rust and Python

Rustarrowpandaspolars
TToucanToco
251 étoiles21