MCPcopy
hub / github.com/pandas-dev/pandas / __init__

Method __init__

pandas/io/excel/_odswriter.py:37–65  ·  view source on GitHub ↗
(  # pyright: ignore[reportInconsistentConstructor]
        self,
        path: FilePath | WriteExcelBuffer | ExcelWriter,
        engine: str | None = None,
        date_format: str | None = None,
        datetime_format: str | None = None,
        mode: str = "w",
        storage_options: StorageOptions | None = None,
        if_sheet_exists: ExcelWriterIfSheetExists | None = None,
        engine_kwargs: dict[str, Any] | None = None,
        **kwargs: Any,
    )

Source from the content-addressed store, hash-verified

35 _supported_extensions = (".ods",)
36
37 def __init__( # pyright: ignore[reportInconsistentConstructor]
38 self,
39 path: FilePath | WriteExcelBuffer | ExcelWriter,
40 engine: str | None = None,
41 date_format: str | None = None,
42 datetime_format: str | None = None,
43 mode: str = "w",
44 storage_options: StorageOptions | None = None,
45 if_sheet_exists: ExcelWriterIfSheetExists | None = None,
46 engine_kwargs: dict[str, Any] | None = None,
47 **kwargs: Any,
48 ) -> None:
49 from odf.opendocument import OpenDocumentSpreadsheet
50
51 if mode == "a":
52 raise ValueError("Append mode is not supported with odf!")
53
54 engine_kwargs = combine_kwargs(engine_kwargs, kwargs)
55 self._book = OpenDocumentSpreadsheet(**engine_kwargs)
56
57 super().__init__(
58 path,
59 mode=mode,
60 storage_options=storage_options,
61 if_sheet_exists=if_sheet_exists,
62 engine_kwargs=engine_kwargs,
63 )
64
65 self._style_dict: dict[str, str] = {}
66
67 @property
68 def book(self) -> OpenDocumentSpreadsheet:

Callers

nothing calls this directly

Calls 1

combine_kwargsFunction · 0.90

Tested by

no test coverage detected