tdrpa.tdworker 1.2.13.2__py312-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tdrpa/_tdxlwings/__init__.py +193 -0
- tdrpa/_tdxlwings/__pycache__/__init__.cpython-311.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/__init__.cpython-38.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/_win32patch.cpython-311.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/_win32patch.cpython-38.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/_xlwindows.cpython-311.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/_xlwindows.cpython-38.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/apps.cpython-311.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/apps.cpython-38.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/base_classes.cpython-311.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/base_classes.cpython-38.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/com_server.cpython-311.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/com_server.cpython-38.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/constants.cpython-311.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/constants.cpython-38.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/expansion.cpython-311.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/expansion.cpython-38.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/main.cpython-311.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/main.cpython-38.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/udfs.cpython-311.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/udfs.cpython-38.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/utils.cpython-311.pyc +0 -0
- tdrpa/_tdxlwings/__pycache__/utils.cpython-38.pyc +0 -0
- tdrpa/_tdxlwings/_win32patch.py +90 -0
- tdrpa/_tdxlwings/_xlmac.py +2240 -0
- tdrpa/_tdxlwings/_xlwindows.py +2518 -0
- tdrpa/_tdxlwings/addin/Dictionary.cls +474 -0
- tdrpa/_tdxlwings/addin/IWebAuthenticator.cls +71 -0
- tdrpa/_tdxlwings/addin/WebClient.cls +772 -0
- tdrpa/_tdxlwings/addin/WebHelpers.bas +3203 -0
- tdrpa/_tdxlwings/addin/WebRequest.cls +875 -0
- tdrpa/_tdxlwings/addin/WebResponse.cls +453 -0
- tdrpa/_tdxlwings/addin/xlwings.xlam +0 -0
- tdrpa/_tdxlwings/apps.py +35 -0
- tdrpa/_tdxlwings/base_classes.py +1092 -0
- tdrpa/_tdxlwings/cli.py +1306 -0
- tdrpa/_tdxlwings/com_server.py +385 -0
- tdrpa/_tdxlwings/constants.py +3080 -0
- tdrpa/_tdxlwings/conversion/__init__.py +103 -0
- tdrpa/_tdxlwings/conversion/framework.py +147 -0
- tdrpa/_tdxlwings/conversion/numpy_conv.py +34 -0
- tdrpa/_tdxlwings/conversion/pandas_conv.py +184 -0
- tdrpa/_tdxlwings/conversion/standard.py +321 -0
- tdrpa/_tdxlwings/expansion.py +83 -0
- tdrpa/_tdxlwings/ext/__init__.py +3 -0
- tdrpa/_tdxlwings/ext/sql.py +73 -0
- tdrpa/_tdxlwings/html/xlwings-alert.html +71 -0
- tdrpa/_tdxlwings/js/xlwings.js +577 -0
- tdrpa/_tdxlwings/js/xlwings.ts +729 -0
- tdrpa/_tdxlwings/mac_dict.py +6399 -0
- tdrpa/_tdxlwings/main.py +5205 -0
- tdrpa/_tdxlwings/mistune/__init__.py +63 -0
- tdrpa/_tdxlwings/mistune/block_parser.py +366 -0
- tdrpa/_tdxlwings/mistune/inline_parser.py +216 -0
- tdrpa/_tdxlwings/mistune/markdown.py +84 -0
- tdrpa/_tdxlwings/mistune/renderers.py +220 -0
- tdrpa/_tdxlwings/mistune/scanner.py +121 -0
- tdrpa/_tdxlwings/mistune/util.py +41 -0
- tdrpa/_tdxlwings/pro/__init__.py +40 -0
- tdrpa/_tdxlwings/pro/_xlcalamine.py +536 -0
- tdrpa/_tdxlwings/pro/_xlofficejs.py +146 -0
- tdrpa/_tdxlwings/pro/_xlremote.py +1293 -0
- tdrpa/_tdxlwings/pro/custom_functions_code.js +150 -0
- tdrpa/_tdxlwings/pro/embedded_code.py +60 -0
- tdrpa/_tdxlwings/pro/udfs_officejs.py +549 -0
- tdrpa/_tdxlwings/pro/utils.py +199 -0
- tdrpa/_tdxlwings/quickstart.xlsm +0 -0
- tdrpa/_tdxlwings/quickstart_addin.xlam +0 -0
- tdrpa/_tdxlwings/quickstart_addin_ribbon.xlam +0 -0
- tdrpa/_tdxlwings/quickstart_fastapi/main.py +47 -0
- tdrpa/_tdxlwings/quickstart_fastapi/requirements.txt +3 -0
- tdrpa/_tdxlwings/quickstart_standalone.xlsm +0 -0
- tdrpa/_tdxlwings/reports.py +12 -0
- tdrpa/_tdxlwings/rest/__init__.py +1 -0
- tdrpa/_tdxlwings/rest/api.py +368 -0
- tdrpa/_tdxlwings/rest/serializers.py +103 -0
- tdrpa/_tdxlwings/server.py +14 -0
- tdrpa/_tdxlwings/udfs.py +775 -0
- tdrpa/_tdxlwings/utils.py +777 -0
- tdrpa/_tdxlwings/xlwings-0.31.6.applescript +30 -0
- tdrpa/_tdxlwings/xlwings.bas +2061 -0
- tdrpa/_tdxlwings/xlwings_custom_addin.bas +2042 -0
- tdrpa/_tdxlwings/xlwingslib.cp38-win_amd64.pyd +0 -0
- tdrpa/tdworker/__init__.pyi +12 -0
- tdrpa/tdworker/_clip.pyi +50 -0
- tdrpa/tdworker/_excel.pyi +743 -0
- tdrpa/tdworker/_file.pyi +77 -0
- tdrpa/tdworker/_img.pyi +226 -0
- tdrpa/tdworker/_network.pyi +94 -0
- tdrpa/tdworker/_os.pyi +47 -0
- tdrpa/tdworker/_sp.pyi +21 -0
- tdrpa/tdworker/_w.pyi +129 -0
- tdrpa/tdworker/_web.pyi +995 -0
- tdrpa/tdworker/_winE.pyi +228 -0
- tdrpa/tdworker/_winK.pyi +74 -0
- tdrpa/tdworker/_winM.pyi +117 -0
- tdrpa/tdworker.cp312-win_amd64.pyd +0 -0
- tdrpa_tdworker-1.2.13.2.dist-info/METADATA +38 -0
- tdrpa_tdworker-1.2.13.2.dist-info/RECORD +101 -0
- tdrpa_tdworker-1.2.13.2.dist-info/WHEEL +5 -0
- tdrpa_tdworker-1.2.13.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,193 @@
|
|
1
|
+
import os
|
2
|
+
import sys
|
3
|
+
from functools import wraps
|
4
|
+
|
5
|
+
__version__ = "0.31.6"
|
6
|
+
|
7
|
+
# Platform specifics
|
8
|
+
if sys.platform.startswith("darwin"):
|
9
|
+
USER_CONFIG_FILE = os.path.join(
|
10
|
+
os.path.expanduser("~"),
|
11
|
+
"Library",
|
12
|
+
"Containers",
|
13
|
+
"com.microsoft.Excel",
|
14
|
+
"Data",
|
15
|
+
"xlwings.conf",
|
16
|
+
)
|
17
|
+
else:
|
18
|
+
USER_CONFIG_FILE = os.path.join(os.path.expanduser("~"), ".xlwings", "xlwings.conf")
|
19
|
+
|
20
|
+
|
21
|
+
# Errors
|
22
|
+
class XlwingsError(Exception):
|
23
|
+
pass
|
24
|
+
|
25
|
+
|
26
|
+
class LicenseError(XlwingsError):
|
27
|
+
pass
|
28
|
+
|
29
|
+
|
30
|
+
class ShapeAlreadyExists(XlwingsError):
|
31
|
+
pass
|
32
|
+
|
33
|
+
|
34
|
+
class NoSuchObjectError(XlwingsError):
|
35
|
+
pass
|
36
|
+
|
37
|
+
|
38
|
+
# API
|
39
|
+
from .main import (
|
40
|
+
App,
|
41
|
+
Book,
|
42
|
+
Chart,
|
43
|
+
Engine,
|
44
|
+
Name,
|
45
|
+
Picture,
|
46
|
+
Range,
|
47
|
+
RangeColumns,
|
48
|
+
RangeRows,
|
49
|
+
Shape,
|
50
|
+
Sheet,
|
51
|
+
apps,
|
52
|
+
books,
|
53
|
+
engines,
|
54
|
+
load,
|
55
|
+
sheets,
|
56
|
+
view,
|
57
|
+
)
|
58
|
+
|
59
|
+
from .utils import xlserial_to_datetime as to_datetime
|
60
|
+
from .apps import AppsBooks
|
61
|
+
|
62
|
+
__all__ = (
|
63
|
+
"App",
|
64
|
+
"Book",
|
65
|
+
"Chart",
|
66
|
+
"Engine",
|
67
|
+
"Name",
|
68
|
+
"Picture",
|
69
|
+
"Range",
|
70
|
+
"RangeColumns",
|
71
|
+
"RangeRows",
|
72
|
+
"Shape",
|
73
|
+
"Sheet",
|
74
|
+
"apps",
|
75
|
+
"books",
|
76
|
+
"engines",
|
77
|
+
"load",
|
78
|
+
"sheets",
|
79
|
+
"view",
|
80
|
+
"to_datetime",
|
81
|
+
"AppsBooks"
|
82
|
+
)
|
83
|
+
|
84
|
+
# Populate engines list
|
85
|
+
has_pywin32 = False
|
86
|
+
if sys.platform.startswith("win"):
|
87
|
+
try:
|
88
|
+
from . import _xlwindows
|
89
|
+
|
90
|
+
engines.add(Engine(impl=_xlwindows.engine))
|
91
|
+
has_pywin32 = True
|
92
|
+
except ImportError:
|
93
|
+
pass
|
94
|
+
if sys.platform.startswith("darwin"):
|
95
|
+
try:
|
96
|
+
from . import _xlmac
|
97
|
+
|
98
|
+
engines.add(Engine(impl=_xlmac.engine))
|
99
|
+
except ImportError:
|
100
|
+
pass
|
101
|
+
|
102
|
+
try:
|
103
|
+
from .pro import _xlofficejs, _xlremote
|
104
|
+
|
105
|
+
engines.add(Engine(impl=_xlremote.engine))
|
106
|
+
engines.add(Engine(impl=_xlofficejs.engine))
|
107
|
+
__pro__ = True
|
108
|
+
except (ImportError, LicenseError, AttributeError):
|
109
|
+
__pro__ = False
|
110
|
+
|
111
|
+
try:
|
112
|
+
# Separately handled in case the Rust extension is missing
|
113
|
+
from .pro import _xlcalamine
|
114
|
+
|
115
|
+
engines.add(Engine(impl=_xlcalamine.engine))
|
116
|
+
except (ImportError, LicenseError, AttributeError):
|
117
|
+
pass
|
118
|
+
|
119
|
+
if "excel" in [engine.name for engine in engines]:
|
120
|
+
# An active engine only really makes sense for the interactive mode with a desktop
|
121
|
+
# installation of Excel. Still, you could activate an engine explicitly via
|
122
|
+
# xw.engines["engine_name"].activate() which might be useful for testing purposes.
|
123
|
+
engines.active = engines["excel"]
|
124
|
+
|
125
|
+
# UDFs
|
126
|
+
if sys.platform.startswith("win") and has_pywin32:
|
127
|
+
from .com_server import serve
|
128
|
+
from .udfs import (
|
129
|
+
get_udf_module,
|
130
|
+
import_udfs,
|
131
|
+
xlarg as arg,
|
132
|
+
xlfunc as func,
|
133
|
+
xlret as ret,
|
134
|
+
xlsub as sub,
|
135
|
+
)
|
136
|
+
|
137
|
+
# This generates the modules for early-binding under %TEMP%\gen_py\3.x
|
138
|
+
# generated via makepy.py -i, but using an old minor=2, as it still seems to
|
139
|
+
# generate the most recent version of it whereas it would fail if the minor is
|
140
|
+
# higher than what exists on the machine. Allowing it to fail silently, as this is
|
141
|
+
# only a hard requirement for ComRange in udf.py which is only used for async funcs,
|
142
|
+
# legacy dynamic arrays, and the 'caller' argument.
|
143
|
+
try:
|
144
|
+
from win32com.client import gencache
|
145
|
+
|
146
|
+
gencache.EnsureModule(
|
147
|
+
"{00020813-0000-0000-C000-000000000046}", lcid=0, major=1, minor=2
|
148
|
+
)
|
149
|
+
except: # noqa: E722
|
150
|
+
pass
|
151
|
+
else:
|
152
|
+
|
153
|
+
def func(f=None, *args, **kwargs):
|
154
|
+
@wraps(f)
|
155
|
+
def inner(f):
|
156
|
+
return f
|
157
|
+
|
158
|
+
if f is None:
|
159
|
+
return inner
|
160
|
+
else:
|
161
|
+
return inner(f)
|
162
|
+
|
163
|
+
def sub(f=None, *args, **kwargs):
|
164
|
+
@wraps(f)
|
165
|
+
def inner(f):
|
166
|
+
return f
|
167
|
+
|
168
|
+
if f is None:
|
169
|
+
return inner
|
170
|
+
else:
|
171
|
+
return inner(f)
|
172
|
+
|
173
|
+
def ret(*args, **kwargs):
|
174
|
+
def inner(f):
|
175
|
+
return f
|
176
|
+
|
177
|
+
return inner
|
178
|
+
|
179
|
+
def arg(*args, **kwargs):
|
180
|
+
def inner(f):
|
181
|
+
return f
|
182
|
+
|
183
|
+
return inner
|
184
|
+
|
185
|
+
def raise_missing_pywin32():
|
186
|
+
raise ImportError(
|
187
|
+
"Couldn't find 'pywin32'. Install it via"
|
188
|
+
"'pip install pywin32' or 'conda install pywin32'."
|
189
|
+
)
|
190
|
+
|
191
|
+
serve = raise_missing_pywin32
|
192
|
+
get_udf_module = raise_missing_pywin32
|
193
|
+
import_udfs = raise_missing_pywin32
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,90 @@
|
|
1
|
+
"""See https://github.com/xlwings/xlwings/issues/1789
|
2
|
+
Can be removed again if there's a solution for
|
3
|
+
https://github.com/mhammond/pywin32/issues/1870
|
4
|
+
|
5
|
+
This file's content is taken from pywin32 v301,
|
6
|
+
distributed under the following license:
|
7
|
+
|
8
|
+
Unless stated in the specfic source file, this work is
|
9
|
+
Copyright (c) 1996-2008, Greg Stein and Mark Hammond.
|
10
|
+
All rights reserved.
|
11
|
+
|
12
|
+
Redistribution and use in source and binary forms, with or without
|
13
|
+
modification, are permitted provided that the following conditions
|
14
|
+
are met:
|
15
|
+
|
16
|
+
Redistributions of source code must retain the above copyright notice,
|
17
|
+
this list of conditions and the following disclaimer.
|
18
|
+
|
19
|
+
Redistributions in binary form must reproduce the above copyright
|
20
|
+
notice, this list of conditions and the following disclaimer in
|
21
|
+
the documentation and/or other materials provided with the distribution.
|
22
|
+
|
23
|
+
Neither names of Greg Stein, Mark Hammond nor the name of contributors may be used
|
24
|
+
to endorse or promote products derived from this software without
|
25
|
+
specific prior written permission.
|
26
|
+
|
27
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
|
28
|
+
IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
29
|
+
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
30
|
+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
|
31
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
32
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
33
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
34
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
35
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
36
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
37
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
38
|
+
"""
|
39
|
+
|
40
|
+
import pythoncom
|
41
|
+
|
42
|
+
|
43
|
+
class CoClassBaseClass:
|
44
|
+
def __init__(self, oobj=None):
|
45
|
+
if oobj is None:
|
46
|
+
oobj = pythoncom.new(self.CLSID)
|
47
|
+
self.__dict__["_dispobj_"] = self.default_interface(oobj)
|
48
|
+
|
49
|
+
def __repr__(self):
|
50
|
+
return "<win32com.gen_py.%s.%s>" % (__doc__, self.__class__.__name__)
|
51
|
+
|
52
|
+
def __getattr__(self, attr):
|
53
|
+
d = self.__dict__["_dispobj_"]
|
54
|
+
if d is not None:
|
55
|
+
return getattr(d, attr)
|
56
|
+
raise AttributeError(attr)
|
57
|
+
|
58
|
+
def __setattr__(self, attr, value):
|
59
|
+
if attr in self.__dict__:
|
60
|
+
self.__dict__[attr] = value
|
61
|
+
return
|
62
|
+
try:
|
63
|
+
d = self.__dict__["_dispobj_"]
|
64
|
+
if d is not None:
|
65
|
+
d.__setattr__(attr, value)
|
66
|
+
return
|
67
|
+
except AttributeError:
|
68
|
+
pass
|
69
|
+
self.__dict__[attr] = value
|
70
|
+
|
71
|
+
# Special methods don't use __getattr__ etc, so explicitly delegate here.
|
72
|
+
# Some wrapped objects might not have them, but that's OK - the attribute
|
73
|
+
# error can just bubble up.
|
74
|
+
def __call__(self, *args, **kwargs):
|
75
|
+
return self.__dict__["_dispobj_"].__call__(*args, **kwargs)
|
76
|
+
|
77
|
+
def __str__(self, *args):
|
78
|
+
return self.__dict__["_dispobj_"].__str__(*args)
|
79
|
+
|
80
|
+
def __int__(self, *args):
|
81
|
+
return self.__dict__["_dispobj_"].__int__(*args)
|
82
|
+
|
83
|
+
def __iter__(self):
|
84
|
+
return self.__dict__["_dispobj_"].__iter__()
|
85
|
+
|
86
|
+
def __len__(self):
|
87
|
+
return self.__dict__["_dispobj_"].__len__()
|
88
|
+
|
89
|
+
def __nonzero__(self):
|
90
|
+
return self.__dict__["_dispobj_"].__nonzero__()
|