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

Class CssExcelCell

pandas/io/formats/excel.py:84–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82
83
84class CssExcelCell(ExcelCell):
85 def __init__(
86 self,
87 row: int,
88 col: int,
89 val,
90 style: dict | None,
91 css_styles: dict[tuple[int, int], list[tuple[str, Any]]] | None,
92 css_row: int,
93 css_col: int,
94 css_converter: Callable | None,
95 **kwargs,
96 ) -> None:
97 if css_styles and css_converter:
98 # Use dict to get only one (case-insensitive) declaration per property
99 declaration_dict = {
100 prop.lower(): val for prop, val in css_styles[css_row, css_col]
101 }
102 # Convert to frozenset for order-invariant caching
103 unique_declarations = frozenset(declaration_dict.items())
104 style = css_converter(unique_declarations)
105
106 super().__init__(row=row, col=col, val=val, style=style, **kwargs)
107
108
109class CSSToExcelConverter:

Callers 7

_format_header_miMethod · 0.85
_format_regular_rowsMethod · 0.85
_generate_bodyMethod · 0.85

Calls

no outgoing calls

Tested by 2