12
12
Callable ,
13
13
Hashable ,
14
14
Sequence ,
15
+ overload ,
15
16
)
16
17
import warnings
17
18
@@ -591,6 +592,52 @@ def to_excel(
591
592
engine = engine ,
592
593
)
593
594
595
+ @overload
596
+ def to_latex (
597
+ self ,
598
+ buf : FilePath | WriteBuffer [str ],
599
+ * ,
600
+ column_format : str | None = ...,
601
+ position : str | None = ...,
602
+ position_float : str | None = ...,
603
+ hrules : bool | None = ...,
604
+ clines : str | None = ...,
605
+ label : str | None = ...,
606
+ caption : str | tuple | None = ...,
607
+ sparse_index : bool | None = ...,
608
+ sparse_columns : bool | None = ...,
609
+ multirow_align : str | None = ...,
610
+ multicol_align : str | None = ...,
611
+ siunitx : bool = ...,
612
+ environment : str | None = ...,
613
+ encoding : str | None = ...,
614
+ convert_css : bool = ...,
615
+ ) -> None :
616
+ ...
617
+
618
+ @overload
619
+ def to_latex (
620
+ self ,
621
+ buf : None = ...,
622
+ * ,
623
+ column_format : str | None = ...,
624
+ position : str | None = ...,
625
+ position_float : str | None = ...,
626
+ hrules : bool | None = ...,
627
+ clines : str | None = ...,
628
+ label : str | None = ...,
629
+ caption : str | tuple | None = ...,
630
+ sparse_index : bool | None = ...,
631
+ sparse_columns : bool | None = ...,
632
+ multirow_align : str | None = ...,
633
+ multicol_align : str | None = ...,
634
+ siunitx : bool = ...,
635
+ environment : str | None = ...,
636
+ encoding : str | None = ...,
637
+ convert_css : bool = ...,
638
+ ) -> str :
639
+ ...
640
+
594
641
def to_latex (
595
642
self ,
596
643
buf : FilePath | WriteBuffer [str ] | None = None ,
@@ -610,7 +657,7 @@ def to_latex(
610
657
environment : str | None = None ,
611
658
encoding : str | None = None ,
612
659
convert_css : bool = False ,
613
- ):
660
+ ) -> str | None :
614
661
r"""
615
662
Write Styler to a file, buffer or string in LaTeX format.
616
663
@@ -1161,6 +1208,46 @@ def to_latex(
1161
1208
)
1162
1209
return save_to_buffer (latex , buf = buf , encoding = encoding )
1163
1210
1211
+ @overload
1212
+ def to_html (
1213
+ self ,
1214
+ buf : FilePath | WriteBuffer [str ],
1215
+ * ,
1216
+ table_uuid : str | None = ...,
1217
+ table_attributes : str | None = ...,
1218
+ sparse_index : bool | None = ...,
1219
+ sparse_columns : bool | None = ...,
1220
+ bold_headers : bool = ...,
1221
+ caption : str | None = ...,
1222
+ max_rows : int | None = ...,
1223
+ max_columns : int | None = ...,
1224
+ encoding : str | None = ...,
1225
+ doctype_html : bool = ...,
1226
+ exclude_styles : bool = ...,
1227
+ ** kwargs ,
1228
+ ) -> None :
1229
+ ...
1230
+
1231
+ @overload
1232
+ def to_html (
1233
+ self ,
1234
+ buf : None = ...,
1235
+ * ,
1236
+ table_uuid : str | None = ...,
1237
+ table_attributes : str | None = ...,
1238
+ sparse_index : bool | None = ...,
1239
+ sparse_columns : bool | None = ...,
1240
+ bold_headers : bool = ...,
1241
+ caption : str | None = ...,
1242
+ max_rows : int | None = ...,
1243
+ max_columns : int | None = ...,
1244
+ encoding : str | None = ...,
1245
+ doctype_html : bool = ...,
1246
+ exclude_styles : bool = ...,
1247
+ ** kwargs ,
1248
+ ) -> str :
1249
+ ...
1250
+
1164
1251
@Substitution (buf = buf , encoding = encoding )
1165
1252
def to_html (
1166
1253
self ,
@@ -1178,7 +1265,7 @@ def to_html(
1178
1265
doctype_html : bool = False ,
1179
1266
exclude_styles : bool = False ,
1180
1267
** kwargs ,
1181
- ):
1268
+ ) -> str | None :
1182
1269
"""
1183
1270
Write Styler to a file, buffer or string in HTML-CSS format.
1184
1271
@@ -1292,18 +1379,46 @@ def to_html(
1292
1379
html , buf = buf , encoding = (encoding if buf is not None else None )
1293
1380
)
1294
1381
1382
+ @overload
1383
+ def to_string (
1384
+ self ,
1385
+ buf : FilePath | WriteBuffer [str ],
1386
+ * ,
1387
+ encoding = ...,
1388
+ sparse_index : bool | None = ...,
1389
+ sparse_columns : bool | None = ...,
1390
+ max_rows : int | None = ...,
1391
+ max_columns : int | None = ...,
1392
+ delimiter : str = ...,
1393
+ ) -> None :
1394
+ ...
1395
+
1396
+ @overload
1397
+ def to_string (
1398
+ self ,
1399
+ buf : None = ...,
1400
+ * ,
1401
+ encoding = ...,
1402
+ sparse_index : bool | None = ...,
1403
+ sparse_columns : bool | None = ...,
1404
+ max_rows : int | None = ...,
1405
+ max_columns : int | None = ...,
1406
+ delimiter : str = ...,
1407
+ ) -> str :
1408
+ ...
1409
+
1295
1410
@Substitution (buf = buf , encoding = encoding )
1296
1411
def to_string (
1297
1412
self ,
1298
- buf = None ,
1413
+ buf : FilePath | WriteBuffer [ str ] | None = None ,
1299
1414
* ,
1300
1415
encoding = None ,
1301
1416
sparse_index : bool | None = None ,
1302
1417
sparse_columns : bool | None = None ,
1303
1418
max_rows : int | None = None ,
1304
1419
max_columns : int | None = None ,
1305
1420
delimiter : str = " " ,
1306
- ):
1421
+ ) -> str | None :
1307
1422
"""
1308
1423
Write Styler to a file, buffer or string in text format.
1309
1424
0 commit comments