Add ODF (.ods) support via odfpy
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user