1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
|
# build-aux/mypy-stubs/xlwt/Formatting.pyi - Type stubs for xlwt
#
# Copyright (C) 2025 Luke T. Shumaker <lukeshu@lukeshu.com>
# SPDX-License-Identifier: AGPL-3.0-or-later
import typing
# These colour indexes are the ranges/values for BIFF5-BIFF8 (Excel
# 5.0 - 2007); older versions are different at >=0x18. AFAICT xlwt
# won't save older versions, so that's fine.
type _FixedColourIndex = typing.Literal[
0x00, # black
0x01, # white
0x02, # red
0x03, # green
0x04, # blue
0x05, # yellow
0x06, # magenta
0x07, # cyan
# ...
0x40, # System window text colour for border lines (used in records XF, CF, and WINDOW2)
0x41, # System window background colour for pattern background (used in records XF, and CF)
# ...
0x43, # System face colour (dialogue background colour)
# ...
0x4D, # System window text colour for chart border lines
0x4E, # System window background colour for chart areas
0x4F, # Automatic colour for chart border lines (seems to be always Black)
0x50, # System ToolTip background colour (used in note objects)
0x51, # System ToolTip text colour (used in note objects)
# ...
0x7FFF, # System window text colour for fonts (used in records FONT, EFONT, and CF)
]
type _UserColourIndex = typing.Literal[
0x08,
0x09,
0x0A,
0x0B,
0x0C,
0x0D,
0x0E,
0x0F,
0x10,
0x11,
0x12,
0x13,
0x14,
0x15,
0x16,
0x17,
0x18,
0x19,
0x1A,
0x1B,
0x1C,
0x1D,
0x1E,
0x1F,
0x20,
0x21,
0x22,
0x23,
0x24,
0x25,
0x26,
0x27,
0x28,
0x29,
0x2A,
0x2B,
0x2C,
0x2D,
0x2E,
0x2F,
0x30,
0x31,
0x32,
0x33,
0x34,
0x35,
0x36,
0x37,
0x38,
0x39,
0x3A,
0x3B,
0x3C,
0x3D,
0x3E,
0x3F,
]
type _ColourIndex = _FixedColourIndex | _UserColourIndex
type _Escapement = typing.Literal[0x00, 0x01, 0x02]
type _Underline = typing.Literal[0x00, 0x01, 0x21, 0x02, 0x22]
type _Family = typing.Literal[0x00, 0x01, 0x02, 0x03, 0x04, 0x05]
type _Charset = typing.Literal[
0x00,
0x01,
0x02,
0x4D,
0x80,
0x81,
0x82,
0x86,
0x88,
0xA1,
0xA2,
0xA3,
0xB1,
0xB2,
0xBA,
0xCC,
0xDE,
0xEE,
0xFF,
]
class Font:
ESCAPEMENT_NONE: _Escapement = ...
ESCAPEMENT_SUPERSCRIPT: _Escapement = ...
ESCAPEMENT_SUBSCRIPT: _Escapement = ...
UNDERLINE_NONE: _Underline = ...
UNDERLINE_SINGLE: _Underline = ...
UNDERLINE_SINGLE_ACC: _Underline = ...
UNDERLINE_DOUBLE: _Underline = ...
UNDERLINE_DOUBLE_ACC: _Underline = ...
FAMILY_NONE: _Family = ...
FAMILY_ROMAN: _Family = ...
FAMILY_SWISS: _Family = ...
FAMILY_MODERN: _Family = ...
FAMILY_SCRIPT: _Family = ...
FAMILY_DECORATIVE: _Family = ...
CHARSET_ANSI_LATIN: _Charset = ...
CHARSET_SYS_DEFAULT: _Charset = ...
CHARSET_SYMBOL: _Charset = ...
CHARSET_APPLE_ROMAN: _Charset = ...
CHARSET_ANSI_JAP_SHIFT_JIS: _Charset = ...
CHARSET_ANSI_KOR_HANGUL: _Charset = ...
CHARSET_ANSI_KOR_JOHAB: _Charset = ...
CHARSET_ANSI_CHINESE_GBK: _Charset = ...
CHARSET_ANSI_CHINESE_BIG5: _Charset = ...
CHARSET_ANSI_GREEK: _Charset = ...
CHARSET_ANSI_TURKISH: _Charset = ...
CHARSET_ANSI_VIETNAMESE: _Charset = ...
CHARSET_ANSI_HEBREW: _Charset = ...
CHARSET_ANSI_ARABIC: _Charset = ...
CHARSET_ANSI_BALTIC: _Charset = ...
CHARSET_ANSI_CYRILLIC: _Charset = ...
CHARSET_ANSI_THAI: _Charset = ...
CHARSET_ANSI_LATIN_II: _Charset = ...
CHARSET_OEM_LATIN_I: _Charset = ...
height: int
italic: bool
struck_out: bool
outline: bool
shadow: bool
colour_index: _ColourIndex
bold: bool
escapement: _Escapement
underline: _Underline
family: _Family
charset: _Charset
name: str
type _Horz = typing.Literal[0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07]
type _Vert = typing.Literal[0x00, 0x01, 0x02, 0x03, 0x04]
type _Direction = typing.Literal[0x00, 0x01, 0x02]
type _Orientation = typing.Literal[0x00, 0x01, 0x02, 0x03]
type _Rotation = typing.Literal[0x00, 0xFF]
type _Wrap = typing.Literal[0x01, 0x00]
type _Shrink = typing.Literal[0x01, 0x00]
class Alignment:
HORZ_GENERAL: _Horz = ...
HORZ_LEFT: _Horz = ...
HORZ_CENTER: _Horz = ...
HORZ_RIGHT: _Horz = ...
HORZ_FILLED: _Horz = ...
HORZ_JUSTIFIED: _Horz = ...
HORZ_CENTER_ACROSS_SEL: _Horz = ...
HORZ_DISTRIBUTED: _Horz = ...
VERT_TOP: _Vert = ...
VERT_CENTER: _Vert = ...
VERT_BOTTOM: _Vert = ...
VERT_JUSTIFIED: _Vert = ...
VERT_DISTRIBUTED: _Vert = ...
DIRECTION_GENERAL: _Direction = ...
DIRECTION_LR: _Direction = ...
DIRECTION_RL: _Direction = ...
ORIENTATION_NOT_ROTATED: _Orientation = ...
ORIENTATION_STACKED: _Orientation = ...
ORIENTATION_90_CC: _Orientation = ...
ORIENTATION_90_CW: _Orientation = ...
ROTATION_0_ANGLE: _Rotation = ...
ROTATION_STACKED: _Rotation = ...
WRAP_AT_RIGHT: _Wrap = ...
NOT_WRAP_AT_RIGHT: _Wrap = ...
SHRINK_TO_FIT: _Shrink = ...
NOT_SHRINK_TO_FIT: _Shrink = ...
horz: _Horz
vert: _Vert
dire: _Direction
orie: _Orientation
rota: _Rotation
wrap: _Wrap
shri: _Shrink
inde: int
merg: int
type _Line = typing.Literal[
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D
]
type _Diag1 = typing.Literal[0x00, 0x01]
type _Diag2 = typing.Literal[0x00, 0x01]
class Borders:
NO_LINE: _Line = ...
THIN: _Line = ...
MEDIUM: _Line = ...
DASHED: _Line = ...
DOTTED: _Line = ...
THICK: _Line = ...
DOUBLE: _Line = ...
HAIR: _Line = ...
MEDIUM_DASHED: _Line = ...
THIN_DASH_DOTTED: _Line = ...
MEDIUM_DASH_DOTTED: _Line = ...
THIN_DASH_DOT_DOTTED: _Line = ...
MEDIUM_DASH_DOT_DOTTED: _Line = ...
SLANTED_MEDIUM_DASH_DOTTED: _Line = ...
NEED_DIAG1: _Diag1 = ...
NEED_DIAG2: _Diag2 = ...
NO_NEED_DIAG1: _Diag1 = ...
NO_NEED_DIAG2: _Diag2 = ...
left: _Line
right: _Line
top: _Line
bottom: _Line
left_colour: _ColourIndex
right_colour: _ColourIndex
top_colour: _ColourIndex
bottom_colour: _ColourIndex
diag_colour: _ColourIndex
need_diag1: _Diag1
need_diag2: _Diag2
type _Pattern = typing.Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
class Pattern:
NO_PATTERN: _Pattern = ...
SOLID_PATTERN: _Pattern = ...
pattern: _Pattern
pattern_fore_colour: _ColourIndex
pattern_back_colour: _ColourIndex
type _Bool = typing.Literal[0, 1]
class Protection:
cell_locked: _Bool
formula_hidden: _Bool
|