Add ODF (.ods) support via odfpy

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-13 11:48:03 +02:00
parent a0be34f66e
commit 2d9bce014f
4 changed files with 33 additions and 3 deletions
+12
View File
@@ -72,6 +72,18 @@ def test_read_column_skip(xlsx_file: Path):
assert "Preis" not in df.columns
def test_read_ods(tmp_path: Path):
pytest.importorskip("odf")
path = tmp_path / "test.ods"
df = pd.DataFrame({"Name": ["Alice", "Bob"], "Wert": [1, 2]})
df.to_excel(path, index=False, engine="odf")
reader = ExcelReader(path)
result = reader.read(SheetConfig(sheet=0, target_table="t"))
assert len(result) == 2
assert list(result.columns) == ["Name", "Wert"]
def test_file_not_found():
with pytest.raises(FileNotFoundError):
ExcelReader("/nonexistent/path/file.xlsx")