MCPcopy
hub / github.com/Textualize/rich / __init__

Method __init__

rich/table.py:188–250  ·  view source on GitHub ↗
(
        self,
        *headers: Union[Column, str],
        title: Optional[TextType] = None,
        caption: Optional[TextType] = None,
        width: Optional[int] = None,
        min_width: Optional[int] = None,
        box: Optional[box.Box] = box.HEAVY_HEAD,
        safe_box: Optional[bool] = None,
        padding: PaddingDimensions = (0, 1),
        collapse_padding: bool = False,
        pad_edge: bool = True,
        expand: bool = False,
        show_header: bool = True,
        show_footer: bool = False,
        show_edge: bool = True,
        show_lines: bool = False,
        leading: int = 0,
        style: StyleType = "none",
        row_styles: Optional[Iterable[StyleType]] = None,
        header_style: Optional[StyleType] = "table.header",
        footer_style: Optional[StyleType] = "table.footer",
        border_style: Optional[StyleType] = None,
        title_style: Optional[StyleType] = None,
        caption_style: Optional[StyleType] = None,
        title_justify: "JustifyMethod" = "center",
        caption_justify: "JustifyMethod" = "center",
        highlight: bool = False,
    )

Source from the content-addressed store, hash-verified

186 rows: List[Row]
187
188 def __init__(
189 self,
190 *headers: Union[Column, str],
191 title: Optional[TextType] = None,
192 caption: Optional[TextType] = None,
193 width: Optional[int] = None,
194 min_width: Optional[int] = None,
195 box: Optional[box.Box] = box.HEAVY_HEAD,
196 safe_box: Optional[bool] = None,
197 padding: PaddingDimensions = (0, 1),
198 collapse_padding: bool = False,
199 pad_edge: bool = True,
200 expand: bool = False,
201 show_header: bool = True,
202 show_footer: bool = False,
203 show_edge: bool = True,
204 show_lines: bool = False,
205 leading: int = 0,
206 style: StyleType = "none",
207 row_styles: Optional[Iterable[StyleType]] = None,
208 header_style: Optional[StyleType] = "table.header",
209 footer_style: Optional[StyleType] = "table.footer",
210 border_style: Optional[StyleType] = None,
211 title_style: Optional[StyleType] = None,
212 caption_style: Optional[StyleType] = None,
213 title_justify: "JustifyMethod" = "center",
214 caption_justify: "JustifyMethod" = "center",
215 highlight: bool = False,
216 ) -> None:
217 self.columns: List[Column] = []
218 self.rows: List[Row] = []
219 self.title = title
220 self.caption = caption
221 self.width = width
222 self.min_width = min_width
223 self.box = box
224 self.safe_box = safe_box
225 self._padding = Padding.unpack(padding)
226 self.pad_edge = pad_edge
227 self._expand = expand
228 self.show_header = show_header
229 self.show_footer = show_footer
230 self.show_edge = show_edge
231 self.show_lines = show_lines
232 self.leading = leading
233 self.collapse_padding = collapse_padding
234 self.style = style
235 self.header_style = header_style or ""
236 self.footer_style = footer_style or ""
237 self.border_style = border_style
238 self.title_style = title_style
239 self.caption_style = caption_style
240 self.title_justify: "JustifyMethod" = title_justify
241 self.caption_justify: "JustifyMethod" = caption_justify
242 self.highlight = highlight
243 self.row_styles: Sequence[StyleType] = list(row_styles or [])
244 append_column = self.columns.append
245 for header in headers:

Callers

nothing calls this directly

Calls 2

add_columnMethod · 0.95
unpackMethod · 0.80

Tested by

no test coverage detected