@@ -1344,6 +1344,87 @@ def get_cell_value(
13441344 err = res .err .decode (ENCODE )
13451345 return res .val .decode (ENCODE ), None if err == "" else Exception (err )
13461346
1347+ def get_col_style (self , sheet : str , col : str ) -> Tuple [int , Optional [Exception ]]:
1348+ """
1349+ Get column style ID by given worksheet name and column name.
1350+
1351+ Args:
1352+ sheet (str): The worksheet name
1353+ col (str): The column name
1354+
1355+ Returns:
1356+ Tuple[int, Optional[Exception]]: A tuple containing the column style
1357+ ID and an exception if an error occurred, otherwise None.
1358+ """
1359+ lib .GetColStyle .restype = types_go ._IntErrorResult
1360+ res = lib .GetColStyle (self .file_index , sheet .encode (ENCODE ), col .encode (ENCODE ))
1361+ err = res .err .decode (ENCODE )
1362+ return res .val , None if err == "" else Exception (err )
1363+
1364+ def get_col_visible (self , sheet : str , col : str ) -> Tuple [bool , Optional [Exception ]]:
1365+ """
1366+ Get visible of a single column by given worksheet name and column name.
1367+
1368+ Args:
1369+ sheet (str): The worksheet name
1370+ col (str): The column name
1371+
1372+ Returns:
1373+ Tuple[bool, Optional[Exception]]: A tuple containing the column
1374+ visible and an exception if an error occurred, otherwise None.
1375+
1376+ Example:
1377+ For example, get visible state of column D in Sheet1:
1378+
1379+ .. code-block:: python
1380+
1381+ visible, err = f.get_col_visible("Sheet1", "D")
1382+ """
1383+ lib .GetColVisible .restype = types_go ._BoolErrorResult
1384+ res = lib .GetColVisible (
1385+ self .file_index , sheet .encode (ENCODE ), col .encode (ENCODE )
1386+ )
1387+ err = res .err .decode (ENCODE )
1388+ return res .val , None if err == "" else Exception (err )
1389+
1390+ def get_default_font (self ) -> Tuple [str , Optional [Exception ]]:
1391+ """
1392+ Get the default font name currently set in the workbook. The spreadsheet
1393+ generated by excelize default font is Calibri.
1394+
1395+ Returns:
1396+ Tuple[str, Optional[Exception]]: A tuple containing the font name as
1397+ a string and an exception if an error occurred, otherwise None.
1398+ """
1399+ lib .GetDefaultFont .restype = types_go ._StringErrorResult
1400+ res = lib .GetDefaultFont (self .file_index )
1401+ err = res .err .decode (ENCODE )
1402+ return res .val .decode (ENCODE ), None if err == "" else Exception (err )
1403+
1404+ def get_row_visible (self , sheet : str , row : int ) -> Tuple [bool , Optional [Exception ]]:
1405+ """
1406+ Get visible of a single row by given worksheet name and Excel row number.
1407+
1408+ Args:
1409+ sheet (str): The worksheet name
1410+ col (str): The column name
1411+
1412+ Returns:
1413+ Tuple[bool, Optional[Exception]]: A tuple containing the column
1414+ visible and an exception if an error occurred, otherwise None.
1415+
1416+ Example:
1417+ For example, get visible state of row 2 in Sheet1:
1418+
1419+ .. code-block:: python
1420+
1421+ visible, err = f.get_row_visible("Sheet1", 2)
1422+ """
1423+ lib .GetRowVisible .restype = types_go ._BoolErrorResult
1424+ res = lib .GetRowVisible (self .file_index , sheet .encode (ENCODE ), c_int (row ))
1425+ err = res .err .decode (ENCODE )
1426+ return res .val , None if err == "" else Exception (err )
1427+
13471428 def get_rows (
13481429 self , sheet : str , * opts : Options
13491430 ) -> Tuple [List [List [str ]], Optional [Exception ]]:
0 commit comments