utils#

The utils module contains the most widely used values for styling elements such as colors and border types for convenience. It is possible to directly use a value that is not present in the utils module as long as the spreadsheet software recognises it.

class number_formats[source]#
Variables:
  • general (str) – ‘General’

  • general_integer (str) – ‘0’

  • general_float (str) – ‘0.00’

  • percent (str) – ‘0.0%’

  • thousands_comma_sep (str) – ‘#,##0’

  • date (str) – ‘DD/MM/YY’

  • time_24_hours (str) – ‘HH:MM’

  • time_24_hours_with_seconds (str) – ‘HH:MM:SS’

  • time_12_hours (str) – ‘h:MM AM/PM’

  • time_12_hours_with_seconds (str) – ‘h:MM:SS AM/PM’

  • date_time (str) – ‘DD/MM/YY HH:MM’

  • date_time_with_seconds (str) – ‘DD/MM/YY HH:MM:SS’

static decimal_with_num_of_digits(num_of_digits: int) str[source]#

New in version 1.6.

Parameters:

num_of_digits (int) – Number of digits after the decimal point

Returns:

A format string that represents a floating point number with the provided number of digits after the decimal point.

For example, utils.number_formats.decimal_with_num_of_digits(2) will return '0.00'

Return type:

str

class colors[source]#
Variables:
  • white (str) – ‘00FFFFFF’

  • blue (str) – ‘000000FF’

  • dark_blue (str) – ‘00000080’

  • yellow (str) – ‘00FFFF00’

  • dark_yellow (str) – ‘00808000’

  • green (str) – ‘0000FF00’

  • dark_green (str) – ‘00008000’

  • black (str) – ‘00000000’

  • red (str) – ‘00FF0000’

  • dark_red (str) – ‘00800000’

  • purple (str) – ‘800080’

  • grey (str) – ‘D3D3D3’

class fonts[source]#

New in version 1.1.

Variables:
  • aegean (str) – ‘Aegean’

  • aegyptus (str) – ‘Aegyptus’

  • aharoni (str) – ‘Aharoni CLM’

  • anaktoria (str) – ‘Anaktoria’

  • analecta (str) – ‘Analecta’

  • anatolian (str) – ‘Anatolian’

  • arial (str) – ‘Arial’

  • calibri (str) – ‘Calibri’

  • david (str) – ‘David CLM’

  • dejavu_sans (str) – ‘DejaVu Sans’

  • ellinia (str) – ‘Ellinia CLM’

class borders[source]#
Variables:
  • dash_dot (str) – ‘dashDot’

  • dash_dot_dot (str) – ‘dashDotDot’

  • dashed (str) – ‘dashed’

  • default_grid (str) – ‘default_grid’

  • dotted (str) – ‘dotted’

  • double (str) – ‘double’

  • hair (str) – ‘hair’

  • medium (str) – ‘medium’

  • medium_dash_dot (str) – ‘mediumDashDot’

  • medium_dash_dot_dot (str) – ‘mediumDashDotDot’

  • medium_dashed (str) – ‘mediumDashed’

  • slant_dash_dot (str) – ‘slantDashDot’

  • thick (str) – ‘thick’

  • thin (str) – ‘thin’

class border_locations[source]#

New in version 4.2.

Variables:
  • top (str) – ‘top’

  • bottom (str) – ‘bottom’

  • left (str) – ‘left’

  • right (str) – ‘right’

class horizontal_alignments[source]#
Variables:
  • general (str) – ‘general’

  • left (str) – ‘left’

  • center (str) – ‘center’

  • right (str) – ‘right’

  • fill (str) – ‘fill’

  • justify (str) – ‘justify’

  • center_continuous (str) – ‘centerContinuous’

  • distributed (str) – ‘distributed’

class vertical_alignments[source]#
Variables:
  • top (str) – ‘top’

  • center (str) – ‘center’

  • bottom (str) – ‘bottom’

  • justify (str) – ‘justify’

  • distributed (str) – ‘distributed’

class underline[source]#
Variables:
  • single (str) – ‘single’

  • double (str) – ‘double’

class fill_pattern_types[source]#

New in version 1.2.

Variables:
  • solid (str) – ‘solid’

  • dark_down (str) – ‘darkDown’

  • dark_gray (str) – ‘darkGray’

  • dark_grid (str) – ‘darkGrid’

  • dark_horizontal (str) – ‘darkHorizontal’

  • dark_trellis (str) – ‘darkTrellis’

  • dark_up (str) – ‘darkUp’

  • dark_vertical (str) – ‘darkVertical’

  • gray0625 (str) – ‘gray0625’

  • gray125 (str) – ‘gray125’

  • light_down (str) – ‘lightDown’

  • light_gray (str) – ‘lightGray’

  • light_grid (str) – ‘lightGrid’

  • light_horizontal (str) – ‘lightHorizontal’

  • light_trellis (str) – ‘lightTrellis’

  • light_up (str) – ‘lightUp’

  • light_vertical (str) – ‘lightVertical’

  • medium_gray (str) – ‘mediumGray’

class conditional_formatting_types[source]#
Variables:
  • num (str) – ‘num’

  • percent (str) – ‘percent’

  • max (str) – ‘max’

  • min (str) – ‘min’

  • formula (str) – ‘formula’

  • percentile (str) – ‘percentile’