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
|
# build-aux/mypy-stubs/xlrd/formula.pyi - Type stubs for xlrd
#
# Copyright (C) 2025 Luke T. Shumaker <lukeshu@lukeshu.com>
# SPDX-License-Identifier: AGPL-3.0-or-later
import typing
import xlrd.book
__all__ = [
# okinds
"oBOOL",
"oERR",
"oNUM",
"oREF",
"oREL",
"oSTRG",
"oUNK",
"okind_dict",
# FMLA_TYPE_*
"FMLA_TYPE_CELL",
"FMLA_TYPE_SHARED",
"FMLA_TYPE_ARRAY",
"FMLA_TYPE_COND_FMT",
"FMLA_TYPE_DATA_VAL",
"FMLA_TYPE_NAME",
# classes
"Operand",
"Ref3D",
# functions
"decompile_formula",
"dump_formula",
"evaluate_name_formula",
"rangename3d",
"rangename3drel",
"cellname",
"cellnameabs",
"colname",
]
oBOOL: int = 3
oERR: int = 4
oMSNG: int = 5
oNUM: int = 2
oREF: int = -1
oREL: int = -2
oSTRG: int = 1
oUNK: int = 0
okind_dict: dict[int, str]
type _k = typing.Literal[3, 4, 5, 2, -1, -2, 1, 0]
type _vBOOL = typing.Literal[0, 1]
type _vERR = None | int
type _vMSNG = None
type _vNUM = float
type _vREF = None | list[Ref3D]
type _vREL = None | list[Ref3D]
type _vSTRG = str
type _vUNK = None
type _v = _vBOOL | _vERR | _vMSNG | _vNUM | _vREF | _vREL | _vSTRG | _vUNK
FMLA_TYPE_CELL: int
FMLA_TYPE_SHARED: int
FMLA_TYPE_ARRAY: int
FMLA_TYPE_COND_FMT: int
FMLA_TYPE_DATA_VAL: int
FMLA_TYPE_NAME: int
class Operand:
value: _v
kind: _k
text: str
rank: int
@typing.overload
def __init__(
self,
akind: typing.Literal[None] = None,
avalue: None = None,
arank: int = 0,
atext: str = "?",
) -> None: ...
@typing.overload
def __init__(
self,
akind: typing.Literal[3],
avalue: _vBOOL | None = None,
arank: int = 0,
atext: str = "?",
) -> None: ...
@typing.overload
def __init__(
self,
akind: typing.Literal[4],
avalue: _vERR | None = None,
arank: int = 0,
atext: str = "?",
) -> None: ...
@typing.overload
def __init__(
self,
akind: typing.Literal[5],
avalue: _vMSNG | None = None,
arank: int = 0,
atext: str = "?",
) -> None: ...
@typing.overload
def __init__(
self,
akind: typing.Literal[2],
avalue: _vNUM | None = None,
arank: int = 0,
atext: str = "?",
) -> None: ...
@typing.overload
def __init__(
self,
akind: typing.Literal[-1],
avalue: _vREF | None = None,
arank: int = 0,
atext: str = "?",
) -> None: ...
@typing.overload
def __init__(
self,
akind: typing.Literal[-2],
avalue: _vREL | None = None,
arank: int = 0,
atext: str = "?",
) -> None: ...
@typing.overload
def __init__(
self,
akind: typing.Literal[1],
avalue: _vSTRG | None = None,
arank: int = 0,
atext: str = "?",
) -> None: ...
@typing.overload
def __init__(
self,
akind: typing.Literal[0],
avalue: _vUNK | None = None,
arank: int = 0,
atext: str = "?",
) -> None: ...
class Ref3D(tuple): # type: ignore
coords: tuple[int, int, int, int, int, int]
relflags: tuple[_vBOOL, _vBOOL, _vBOOL, _vBOOL, _vBOOL, _vBOOL]
def __init__(
self,
atuple: tuple[
int, int, int, int, int, int, _vBOOL, _vBOOL, _vBOOL, _vBOOL, _vBOOL, _vBOOL
],
) -> None: ...
def rangename3d(book: xlrd.book.Book, ref3d: Ref3D) -> str: ...
def rangename3drel(
book: xlrd.book.Book,
ref3d: Ref3D,
browx: int | None = None,
bcolx: int | None = None,
r1c1: bool | _vBOOL = 0,
) -> str: ...
def cellname(rowx: int, colx: int) -> str: ...
def cellnameabs(rowx: int, colx: int, r1c1: bool | _vBOOL = 0) -> str: ...
def colname(colx: int) -> str: ...
|