xlwings-utils 25.0.0.post3__tar.gz → 25.0.0.post4__tar.gz
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.
Potentially problematic release.
This version of xlwings-utils might be problematic. Click here for more details.
- {xlwings_utils-25.0.0.post3 → xlwings_utils-25.0.0.post4}/PKG-INFO +45 -14
- {xlwings_utils-25.0.0.post3 → xlwings_utils-25.0.0.post4}/README.md +44 -13
- {xlwings_utils-25.0.0.post3 → xlwings_utils-25.0.0.post4}/pyproject.toml +1 -1
- {xlwings_utils-25.0.0.post3 → xlwings_utils-25.0.0.post4}/xlwings_utils/xlwings_utils.py +1 -10
- {xlwings_utils-25.0.0.post3 → xlwings_utils-25.0.0.post4}/xlwings_utils.egg-info/PKG-INFO +45 -14
- {xlwings_utils-25.0.0.post3 → xlwings_utils-25.0.0.post4}/setup.cfg +0 -0
- {xlwings_utils-25.0.0.post3 → xlwings_utils-25.0.0.post4}/tests/test_xlwings_utils.py +0 -0
- {xlwings_utils-25.0.0.post3 → xlwings_utils-25.0.0.post4}/xlwings_utils/__init__.py +0 -0
- {xlwings_utils-25.0.0.post3 → xlwings_utils-25.0.0.post4}/xlwings_utils.egg-info/SOURCES.txt +0 -0
- {xlwings_utils-25.0.0.post3 → xlwings_utils-25.0.0.post4}/xlwings_utils.egg-info/dependency_links.txt +0 -0
- {xlwings_utils-25.0.0.post3 → xlwings_utils-25.0.0.post4}/xlwings_utils.egg-info/requires.txt +0 -0
- {xlwings_utils-25.0.0.post3 → xlwings_utils-25.0.0.post4}/xlwings_utils.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xlwings_utils
|
|
3
|
-
Version: 25.0.0.
|
|
3
|
+
Version: 25.0.0.post4
|
|
4
4
|
Summary: xlwings_utils
|
|
5
5
|
Author-email: Ruud van der Ham <rt.van.der.ham@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/salabim/xlwings_utils
|
|
@@ -30,6 +30,16 @@ In the script, add
|
|
|
30
30
|
>
|
|
31
31
|
> The GitHub repository can be found on https://github.com/salabim/xlwings_utils .
|
|
32
32
|
|
|
33
|
+
General
|
|
34
|
+
|
|
35
|
+
It is recommended to put
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
import xlwings_utils as xwu
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
at the top of a xlwings lite script.
|
|
42
|
+
|
|
33
43
|
## Dropbox support
|
|
34
44
|
|
|
35
45
|
The xlwings lite system does not provide access to the local file system. With this module, files can be copied between Dropbox and the local pyodide file system, making it possible to indirectly use the local file system.
|
|
@@ -50,15 +60,15 @@ The functions `list_local`, `read_local` and `write_local` offer similar functio
|
|
|
50
60
|
So, a way to access a file on the system's drive (mapped to Dropbox) as a local file is:
|
|
51
61
|
|
|
52
62
|
```
|
|
53
|
-
contents =
|
|
54
|
-
|
|
63
|
+
contents = xwu.read_dropbox('/downloads/file1.xls')
|
|
64
|
+
xwu.write_local('file1.xlsx')
|
|
55
65
|
df = pandas.read_excel"file1.xlsx")
|
|
56
66
|
...
|
|
57
67
|
```
|
|
58
68
|
And the other direction:
|
|
59
69
|
```
|
|
60
|
-
contents =
|
|
61
|
-
|
|
70
|
+
contents = xwu.read_local('file1.gif')
|
|
71
|
+
xwu.write_dropbox('/downloads/file1.gif')
|
|
62
72
|
```
|
|
63
73
|
|
|
64
74
|
## Block support
|
|
@@ -89,7 +99,7 @@ It is not allowed t,o read or write outside the block dimensions.
|
|
|
89
99
|
|
|
90
100
|
It is also possible to define an empty block, like
|
|
91
101
|
```
|
|
92
|
-
block =
|
|
102
|
+
block = xwu.block(number_of_rows, number_columns)
|
|
93
103
|
```
|
|
94
104
|
The dimensions can be queried or redefined with `block.number_of_rows` and
|
|
95
105
|
`block.number_of_columns`.
|
|
@@ -191,12 +201,35 @@ The module has support for capturing stdout and -later- using showing the captur
|
|
|
191
201
|
|
|
192
202
|
This is rather important as printing in xlwings lite to the UI pane is rather slow.
|
|
193
203
|
|
|
194
|
-
In order to capture stdout output,
|
|
204
|
+
In order to capture stdout output, it is required to first issue
|
|
205
|
+
|
|
206
|
+
```caoture
|
|
207
|
+
capture = xwu.Capture()
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
By this, capture is automatically enabled and print is disabled. Alternatively, it is possible to use
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
capture = xwu.Capture(enabled=False)
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
to disable the capture. And with
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
capture = xwu.Capture(include_print=True)
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
the stdout output is captured and printed.
|
|
223
|
+
|
|
224
|
+
Capturing van be enabled and disabled at any time with `capture.enbaled = True` and `capture.enabled = False`.
|
|
225
|
+
|
|
226
|
+
And including print likewise with `capture.include_print`.
|
|
227
|
+
|
|
195
228
|
Alternatively, a context manager is provided:
|
|
196
229
|
|
|
197
230
|
|
|
198
231
|
```
|
|
199
|
-
with
|
|
232
|
+
with capture:
|
|
200
233
|
"""
|
|
201
234
|
code with print statements
|
|
202
235
|
"""
|
|
@@ -206,17 +239,15 @@ Note that stopping the capture, leaves the captured output in place, so it can b
|
|
|
206
239
|
In either case, the captured output can be then copied to a sheet, like
|
|
207
240
|
|
|
208
241
|
```
|
|
209
|
-
sheet.range(4,5).value =
|
|
242
|
+
sheet.range(4,5).value = capture.value
|
|
210
243
|
```
|
|
211
244
|
Upon reading the value, the capture buffer will be emptied.
|
|
212
245
|
|
|
213
|
-
If you don't want the buffer to be emptied after accessing the value, use `
|
|
214
|
-
|
|
215
|
-
The capture buffer can also be retrieved as a string with `xwu.capture.str` and `xwu.capture.str_keep`.
|
|
246
|
+
If you don't want the buffer to be emptied after accessing the value, use `capture.value_keep`.
|
|
216
247
|
|
|
217
|
-
|
|
248
|
+
The capture buffer can also be retrieved as a string with `capture.str` and `capture.str_keep`.
|
|
218
249
|
|
|
219
|
-
|
|
250
|
+
Clearing the captured stdout buffer can be done at any time with `capture.clear()`.
|
|
220
251
|
|
|
221
252
|
|
|
222
253
|
## Contact info
|
|
@@ -16,6 +16,16 @@ In the script, add
|
|
|
16
16
|
>
|
|
17
17
|
> The GitHub repository can be found on https://github.com/salabim/xlwings_utils .
|
|
18
18
|
|
|
19
|
+
General
|
|
20
|
+
|
|
21
|
+
It is recommended to put
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
import xlwings_utils as xwu
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
at the top of a xlwings lite script.
|
|
28
|
+
|
|
19
29
|
## Dropbox support
|
|
20
30
|
|
|
21
31
|
The xlwings lite system does not provide access to the local file system. With this module, files can be copied between Dropbox and the local pyodide file system, making it possible to indirectly use the local file system.
|
|
@@ -36,15 +46,15 @@ The functions `list_local`, `read_local` and `write_local` offer similar functio
|
|
|
36
46
|
So, a way to access a file on the system's drive (mapped to Dropbox) as a local file is:
|
|
37
47
|
|
|
38
48
|
```
|
|
39
|
-
contents =
|
|
40
|
-
|
|
49
|
+
contents = xwu.read_dropbox('/downloads/file1.xls')
|
|
50
|
+
xwu.write_local('file1.xlsx')
|
|
41
51
|
df = pandas.read_excel"file1.xlsx")
|
|
42
52
|
...
|
|
43
53
|
```
|
|
44
54
|
And the other direction:
|
|
45
55
|
```
|
|
46
|
-
contents =
|
|
47
|
-
|
|
56
|
+
contents = xwu.read_local('file1.gif')
|
|
57
|
+
xwu.write_dropbox('/downloads/file1.gif')
|
|
48
58
|
```
|
|
49
59
|
|
|
50
60
|
## Block support
|
|
@@ -75,7 +85,7 @@ It is not allowed t,o read or write outside the block dimensions.
|
|
|
75
85
|
|
|
76
86
|
It is also possible to define an empty block, like
|
|
77
87
|
```
|
|
78
|
-
block =
|
|
88
|
+
block = xwu.block(number_of_rows, number_columns)
|
|
79
89
|
```
|
|
80
90
|
The dimensions can be queried or redefined with `block.number_of_rows` and
|
|
81
91
|
`block.number_of_columns`.
|
|
@@ -177,12 +187,35 @@ The module has support for capturing stdout and -later- using showing the captur
|
|
|
177
187
|
|
|
178
188
|
This is rather important as printing in xlwings lite to the UI pane is rather slow.
|
|
179
189
|
|
|
180
|
-
In order to capture stdout output,
|
|
190
|
+
In order to capture stdout output, it is required to first issue
|
|
191
|
+
|
|
192
|
+
```caoture
|
|
193
|
+
capture = xwu.Capture()
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
By this, capture is automatically enabled and print is disabled. Alternatively, it is possible to use
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
capture = xwu.Capture(enabled=False)
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
to disable the capture. And with
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
capture = xwu.Capture(include_print=True)
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
the stdout output is captured and printed.
|
|
209
|
+
|
|
210
|
+
Capturing van be enabled and disabled at any time with `capture.enbaled = True` and `capture.enabled = False`.
|
|
211
|
+
|
|
212
|
+
And including print likewise with `capture.include_print`.
|
|
213
|
+
|
|
181
214
|
Alternatively, a context manager is provided:
|
|
182
215
|
|
|
183
216
|
|
|
184
217
|
```
|
|
185
|
-
with
|
|
218
|
+
with capture:
|
|
186
219
|
"""
|
|
187
220
|
code with print statements
|
|
188
221
|
"""
|
|
@@ -192,17 +225,15 @@ Note that stopping the capture, leaves the captured output in place, so it can b
|
|
|
192
225
|
In either case, the captured output can be then copied to a sheet, like
|
|
193
226
|
|
|
194
227
|
```
|
|
195
|
-
sheet.range(4,5).value =
|
|
228
|
+
sheet.range(4,5).value = capture.value
|
|
196
229
|
```
|
|
197
230
|
Upon reading the value, the capture buffer will be emptied.
|
|
198
231
|
|
|
199
|
-
If you don't want the buffer to be emptied after accessing the value, use `
|
|
200
|
-
|
|
201
|
-
The capture buffer can also be retrieved as a string with `xwu.capture.str` and `xwu.capture.str_keep`.
|
|
232
|
+
If you don't want the buffer to be emptied after accessing the value, use `capture.value_keep`.
|
|
202
233
|
|
|
203
|
-
|
|
234
|
+
The capture buffer can also be retrieved as a string with `capture.str` and `capture.str_keep`.
|
|
204
235
|
|
|
205
|
-
|
|
236
|
+
Clearing the captured stdout buffer can be done at any time with `capture.clear()`.
|
|
206
237
|
|
|
207
238
|
|
|
208
239
|
## Contact info
|
|
@@ -636,7 +636,7 @@ class block:
|
|
|
636
636
|
return self.vlookup(s, row_from=row_from, row_to=row_to, column1=column1, column2=column2)
|
|
637
637
|
|
|
638
638
|
|
|
639
|
-
class
|
|
639
|
+
class Capture:
|
|
640
640
|
"""
|
|
641
641
|
specifies how to capture stdout
|
|
642
642
|
|
|
@@ -721,15 +721,6 @@ class _capture:
|
|
|
721
721
|
self._include_print = value
|
|
722
722
|
|
|
723
723
|
|
|
724
|
-
def reset():
|
|
725
|
-
capture.enabled = False
|
|
726
|
-
capture.include_print = False
|
|
727
|
-
capture.clear()
|
|
728
|
-
print('reset',sys.stdout)
|
|
729
|
-
|
|
730
|
-
capture = _capture()
|
|
731
|
-
|
|
732
|
-
|
|
733
724
|
if __name__ == "__main__":
|
|
734
725
|
...
|
|
735
726
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xlwings_utils
|
|
3
|
-
Version: 25.0.0.
|
|
3
|
+
Version: 25.0.0.post4
|
|
4
4
|
Summary: xlwings_utils
|
|
5
5
|
Author-email: Ruud van der Ham <rt.van.der.ham@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/salabim/xlwings_utils
|
|
@@ -30,6 +30,16 @@ In the script, add
|
|
|
30
30
|
>
|
|
31
31
|
> The GitHub repository can be found on https://github.com/salabim/xlwings_utils .
|
|
32
32
|
|
|
33
|
+
General
|
|
34
|
+
|
|
35
|
+
It is recommended to put
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
import xlwings_utils as xwu
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
at the top of a xlwings lite script.
|
|
42
|
+
|
|
33
43
|
## Dropbox support
|
|
34
44
|
|
|
35
45
|
The xlwings lite system does not provide access to the local file system. With this module, files can be copied between Dropbox and the local pyodide file system, making it possible to indirectly use the local file system.
|
|
@@ -50,15 +60,15 @@ The functions `list_local`, `read_local` and `write_local` offer similar functio
|
|
|
50
60
|
So, a way to access a file on the system's drive (mapped to Dropbox) as a local file is:
|
|
51
61
|
|
|
52
62
|
```
|
|
53
|
-
contents =
|
|
54
|
-
|
|
63
|
+
contents = xwu.read_dropbox('/downloads/file1.xls')
|
|
64
|
+
xwu.write_local('file1.xlsx')
|
|
55
65
|
df = pandas.read_excel"file1.xlsx")
|
|
56
66
|
...
|
|
57
67
|
```
|
|
58
68
|
And the other direction:
|
|
59
69
|
```
|
|
60
|
-
contents =
|
|
61
|
-
|
|
70
|
+
contents = xwu.read_local('file1.gif')
|
|
71
|
+
xwu.write_dropbox('/downloads/file1.gif')
|
|
62
72
|
```
|
|
63
73
|
|
|
64
74
|
## Block support
|
|
@@ -89,7 +99,7 @@ It is not allowed t,o read or write outside the block dimensions.
|
|
|
89
99
|
|
|
90
100
|
It is also possible to define an empty block, like
|
|
91
101
|
```
|
|
92
|
-
block =
|
|
102
|
+
block = xwu.block(number_of_rows, number_columns)
|
|
93
103
|
```
|
|
94
104
|
The dimensions can be queried or redefined with `block.number_of_rows` and
|
|
95
105
|
`block.number_of_columns`.
|
|
@@ -191,12 +201,35 @@ The module has support for capturing stdout and -later- using showing the captur
|
|
|
191
201
|
|
|
192
202
|
This is rather important as printing in xlwings lite to the UI pane is rather slow.
|
|
193
203
|
|
|
194
|
-
In order to capture stdout output,
|
|
204
|
+
In order to capture stdout output, it is required to first issue
|
|
205
|
+
|
|
206
|
+
```caoture
|
|
207
|
+
capture = xwu.Capture()
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
By this, capture is automatically enabled and print is disabled. Alternatively, it is possible to use
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
capture = xwu.Capture(enabled=False)
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
to disable the capture. And with
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
capture = xwu.Capture(include_print=True)
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
the stdout output is captured and printed.
|
|
223
|
+
|
|
224
|
+
Capturing van be enabled and disabled at any time with `capture.enbaled = True` and `capture.enabled = False`.
|
|
225
|
+
|
|
226
|
+
And including print likewise with `capture.include_print`.
|
|
227
|
+
|
|
195
228
|
Alternatively, a context manager is provided:
|
|
196
229
|
|
|
197
230
|
|
|
198
231
|
```
|
|
199
|
-
with
|
|
232
|
+
with capture:
|
|
200
233
|
"""
|
|
201
234
|
code with print statements
|
|
202
235
|
"""
|
|
@@ -206,17 +239,15 @@ Note that stopping the capture, leaves the captured output in place, so it can b
|
|
|
206
239
|
In either case, the captured output can be then copied to a sheet, like
|
|
207
240
|
|
|
208
241
|
```
|
|
209
|
-
sheet.range(4,5).value =
|
|
242
|
+
sheet.range(4,5).value = capture.value
|
|
210
243
|
```
|
|
211
244
|
Upon reading the value, the capture buffer will be emptied.
|
|
212
245
|
|
|
213
|
-
If you don't want the buffer to be emptied after accessing the value, use `
|
|
214
|
-
|
|
215
|
-
The capture buffer can also be retrieved as a string with `xwu.capture.str` and `xwu.capture.str_keep`.
|
|
246
|
+
If you don't want the buffer to be emptied after accessing the value, use `capture.value_keep`.
|
|
216
247
|
|
|
217
|
-
|
|
248
|
+
The capture buffer can also be retrieved as a string with `capture.str` and `capture.str_keep`.
|
|
218
249
|
|
|
219
|
-
|
|
250
|
+
Clearing the captured stdout buffer can be done at any time with `capture.clear()`.
|
|
220
251
|
|
|
221
252
|
|
|
222
253
|
## Contact info
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{xlwings_utils-25.0.0.post3 → xlwings_utils-25.0.0.post4}/xlwings_utils.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{xlwings_utils-25.0.0.post3 → xlwings_utils-25.0.0.post4}/xlwings_utils.egg-info/requires.txt
RENAMED
|
File without changes
|
{xlwings_utils-25.0.0.post3 → xlwings_utils-25.0.0.post4}/xlwings_utils.egg-info/top_level.txt
RENAMED
|
File without changes
|