dycw-utilities 0.120.0__py3-none-any.whl → 0.121.1__py3-none-any.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.
- {dycw_utilities-0.120.0.dist-info → dycw_utilities-0.121.1.dist-info}/METADATA +37 -37
- {dycw_utilities-0.120.0.dist-info → dycw_utilities-0.121.1.dist-info}/RECORD +8 -8
- utilities/__init__.py +1 -1
- utilities/asyncio.py +21 -13
- utilities/polars.py +5 -5
- utilities/types.py +2 -0
- {dycw_utilities-0.120.0.dist-info → dycw_utilities-0.121.1.dist-info}/WHEEL +0 -0
- {dycw_utilities-0.120.0.dist-info → dycw_utilities-0.121.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,12 +1,12 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: dycw-utilities
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.121.1
|
4
4
|
Author-email: Derek Wan <d.wan@icloud.com>
|
5
5
|
License-File: LICENSE
|
6
6
|
Requires-Python: >=3.12
|
7
7
|
Requires-Dist: typing-extensions<4.14,>=4.13.1
|
8
8
|
Provides-Extra: test
|
9
|
-
Requires-Dist: hypothesis<6.132,>=6.131.
|
9
|
+
Requires-Dist: hypothesis<6.132,>=6.131.21; extra == 'test'
|
10
10
|
Requires-Dist: pytest-asyncio<0.27,>=0.26.0; extra == 'test'
|
11
11
|
Requires-Dist: pytest-cov<6.2,>=6.1.1; extra == 'test'
|
12
12
|
Requires-Dist: pytest-instafail<0.6,>=0.5.0; extra == 'test'
|
@@ -24,9 +24,9 @@ Provides-Extra: zzz-test-altair
|
|
24
24
|
Requires-Dist: altair<5.6,>=5.5.0; extra == 'zzz-test-altair'
|
25
25
|
Requires-Dist: atomicwrites<1.5,>=1.4.1; extra == 'zzz-test-altair'
|
26
26
|
Requires-Dist: img2pdf<0.7,>=0.6.0; extra == 'zzz-test-altair'
|
27
|
-
Requires-Dist: polars-lts-cpu<1.
|
27
|
+
Requires-Dist: polars-lts-cpu<1.31,>=1.30.0; extra == 'zzz-test-altair'
|
28
28
|
Requires-Dist: vl-convert-python<1.8,>=1.7.0; extra == 'zzz-test-altair'
|
29
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
29
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-altair'
|
30
30
|
Provides-Extra: zzz-test-astor
|
31
31
|
Requires-Dist: astor<0.9,>=0.8.1; extra == 'zzz-test-astor'
|
32
32
|
Provides-Extra: zzz-test-asyncio
|
@@ -37,9 +37,9 @@ Requires-Dist: atools<0.15,>=0.14.2; extra == 'zzz-test-atools'
|
|
37
37
|
Provides-Extra: zzz-test-cachetools
|
38
38
|
Requires-Dist: cachetools<5.6,>=5.5.2; extra == 'zzz-test-cachetools'
|
39
39
|
Provides-Extra: zzz-test-click
|
40
|
-
Requires-Dist: click<8.3,>=8.2.
|
40
|
+
Requires-Dist: click<8.3,>=8.2.1; extra == 'zzz-test-click'
|
41
41
|
Requires-Dist: sqlalchemy<2.1,>=2.0.41; extra == 'zzz-test-click'
|
42
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
42
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-click'
|
43
43
|
Provides-Extra: zzz-test-contextlib
|
44
44
|
Provides-Extra: zzz-test-contextvars
|
45
45
|
Provides-Extra: zzz-test-cryptography
|
@@ -48,11 +48,11 @@ Provides-Extra: zzz-test-cvxpy
|
|
48
48
|
Requires-Dist: cvxpy<1.7,>=1.6.5; extra == 'zzz-test-cvxpy'
|
49
49
|
Provides-Extra: zzz-test-dataclasses
|
50
50
|
Requires-Dist: orjson<3.11,>=3.10.15; extra == 'zzz-test-dataclasses'
|
51
|
-
Requires-Dist: polars-lts-cpu<1.
|
52
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
51
|
+
Requires-Dist: polars-lts-cpu<1.31,>=1.30.0; extra == 'zzz-test-dataclasses'
|
52
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-dataclasses'
|
53
53
|
Provides-Extra: zzz-test-datetime
|
54
54
|
Requires-Dist: tzlocal<5.4,>=5.3.1; extra == 'zzz-test-datetime'
|
55
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
55
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-datetime'
|
56
56
|
Provides-Extra: zzz-test-enum
|
57
57
|
Provides-Extra: zzz-test-errors
|
58
58
|
Provides-Extra: zzz-test-eventkit
|
@@ -70,17 +70,17 @@ Provides-Extra: zzz-test-getpass
|
|
70
70
|
Provides-Extra: zzz-test-git
|
71
71
|
Provides-Extra: zzz-test-hashlib
|
72
72
|
Requires-Dist: orjson<3.11,>=3.10.15; extra == 'zzz-test-hashlib'
|
73
|
-
Requires-Dist: polars-lts-cpu<1.
|
74
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
73
|
+
Requires-Dist: polars-lts-cpu<1.31,>=1.30.0; extra == 'zzz-test-hashlib'
|
74
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-hashlib'
|
75
75
|
Provides-Extra: zzz-test-http
|
76
76
|
Requires-Dist: atomicwrites<1.5,>=1.4.1; extra == 'zzz-test-http'
|
77
77
|
Requires-Dist: orjson<3.11,>=3.10.18; extra == 'zzz-test-http'
|
78
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
78
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-http'
|
79
79
|
Provides-Extra: zzz-test-hypothesis
|
80
80
|
Requires-Dist: aiosqlite<0.22,>=0.21.0; extra == 'zzz-test-hypothesis'
|
81
81
|
Requires-Dist: asyncpg<0.31,>=0.30.0; extra == 'zzz-test-hypothesis'
|
82
82
|
Requires-Dist: greenlet<3.3,>=3.2.0; extra == 'zzz-test-hypothesis'
|
83
|
-
Requires-Dist: hypothesis<6.132,>=6.131.
|
83
|
+
Requires-Dist: hypothesis<6.132,>=6.131.21; extra == 'zzz-test-hypothesis'
|
84
84
|
Requires-Dist: luigi<3.7,>=3.6.0; extra == 'zzz-test-hypothesis'
|
85
85
|
Requires-Dist: numpy<2.3,>=2.2.6; extra == 'zzz-test-hypothesis'
|
86
86
|
Requires-Dist: pathvalidate<3.3,>=3.2.3; extra == 'zzz-test-hypothesis'
|
@@ -88,16 +88,16 @@ Requires-Dist: redis<6.2,>=6.1.0; extra == 'zzz-test-hypothesis'
|
|
88
88
|
Requires-Dist: sqlalchemy<2.1,>=2.0.41; extra == 'zzz-test-hypothesis'
|
89
89
|
Requires-Dist: tenacity<9.0,>=8.5.0; extra == 'zzz-test-hypothesis'
|
90
90
|
Requires-Dist: tzlocal<5.4,>=5.3.1; extra == 'zzz-test-hypothesis'
|
91
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
91
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-hypothesis'
|
92
92
|
Provides-Extra: zzz-test-ipython
|
93
93
|
Requires-Dist: ipython<9.1,>=9.0.1; extra == 'zzz-test-ipython'
|
94
94
|
Provides-Extra: zzz-test-iterables
|
95
|
-
Requires-Dist: polars-lts-cpu<1.
|
96
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
95
|
+
Requires-Dist: polars-lts-cpu<1.31,>=1.30.0; extra == 'zzz-test-iterables'
|
96
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-iterables'
|
97
97
|
Provides-Extra: zzz-test-jupyter
|
98
98
|
Requires-Dist: jupyterlab<4.3,>=4.2.0; extra == 'zzz-test-jupyter'
|
99
99
|
Requires-Dist: pandas<2.3,>=2.2.2; extra == 'zzz-test-jupyter'
|
100
|
-
Requires-Dist: polars-lts-cpu<1.
|
100
|
+
Requires-Dist: polars-lts-cpu<1.31,>=1.30.0; extra == 'zzz-test-jupyter'
|
101
101
|
Provides-Extra: zzz-test-logging
|
102
102
|
Requires-Dist: atomicwrites<1.5,>=1.4.1; extra == 'zzz-test-logging'
|
103
103
|
Requires-Dist: coloredlogs<15.1,>=15.0.1; extra == 'zzz-test-logging'
|
@@ -105,12 +105,12 @@ Requires-Dist: concurrent-log-handler<0.10,>=0.9.26; extra == 'zzz-test-logging'
|
|
105
105
|
Requires-Dist: rich<14.1,>=14.0.0; extra == 'zzz-test-logging'
|
106
106
|
Requires-Dist: tomlkit<0.14,>=0.13.2; extra == 'zzz-test-logging'
|
107
107
|
Requires-Dist: tzlocal<5.4,>=5.3.1; extra == 'zzz-test-logging'
|
108
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
108
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-logging'
|
109
109
|
Provides-Extra: zzz-test-loguru
|
110
110
|
Requires-Dist: loguru<0.8,>=0.7.3; extra == 'zzz-test-loguru'
|
111
111
|
Provides-Extra: zzz-test-luigi
|
112
112
|
Requires-Dist: luigi<3.7,>=3.6.0; extra == 'zzz-test-luigi'
|
113
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
113
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-luigi'
|
114
114
|
Provides-Extra: zzz-test-math
|
115
115
|
Requires-Dist: numpy<2.3,>=2.2.6; extra == 'zzz-test-math'
|
116
116
|
Provides-Extra: zzz-test-memory-profiler
|
@@ -121,24 +121,24 @@ Requires-Dist: more-itertools<10.8,>=10.7.0; extra == 'zzz-test-more-itertools'
|
|
121
121
|
Provides-Extra: zzz-test-numpy
|
122
122
|
Requires-Dist: numpy<2.3,>=2.2.6; extra == 'zzz-test-numpy'
|
123
123
|
Provides-Extra: zzz-test-operator
|
124
|
-
Requires-Dist: polars-lts-cpu<1.
|
125
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
124
|
+
Requires-Dist: polars-lts-cpu<1.31,>=1.30.0; extra == 'zzz-test-operator'
|
125
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-operator'
|
126
126
|
Provides-Extra: zzz-test-optuna
|
127
127
|
Requires-Dist: optuna<4.4,>=4.3.0; extra == 'zzz-test-optuna'
|
128
128
|
Provides-Extra: zzz-test-orjson
|
129
129
|
Requires-Dist: orjson<3.11,>=3.10.15; extra == 'zzz-test-orjson'
|
130
|
-
Requires-Dist: polars-lts-cpu<1.
|
130
|
+
Requires-Dist: polars-lts-cpu<1.31,>=1.30.0; extra == 'zzz-test-orjson'
|
131
131
|
Requires-Dist: rich<14.1,>=14.0.0; extra == 'zzz-test-orjson'
|
132
132
|
Requires-Dist: tzlocal<5.4,>=5.3.1; extra == 'zzz-test-orjson'
|
133
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
133
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-orjson'
|
134
134
|
Provides-Extra: zzz-test-os
|
135
135
|
Provides-Extra: zzz-test-pathlib
|
136
136
|
Provides-Extra: zzz-test-pickle
|
137
137
|
Requires-Dist: atomicwrites<1.5,>=1.4.1; extra == 'zzz-test-pickle'
|
138
138
|
Provides-Extra: zzz-test-platform
|
139
139
|
Provides-Extra: zzz-test-polars
|
140
|
-
Requires-Dist: polars-lts-cpu<1.
|
141
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
140
|
+
Requires-Dist: polars-lts-cpu<1.31,>=1.30.0; extra == 'zzz-test-polars'
|
141
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-polars'
|
142
142
|
Provides-Extra: zzz-test-pqdm
|
143
143
|
Requires-Dist: pqdm<0.3,>=0.2.0; extra == 'zzz-test-pqdm'
|
144
144
|
Provides-Extra: zzz-test-pydantic
|
@@ -153,22 +153,22 @@ Requires-Dist: pyrsistent<0.21,>=0.20.0; extra == 'zzz-test-pyrsistent'
|
|
153
153
|
Provides-Extra: zzz-test-pytest
|
154
154
|
Requires-Dist: atomicwrites<1.5,>=1.4.1; extra == 'zzz-test-pytest'
|
155
155
|
Requires-Dist: orjson<3.11,>=3.10.18; extra == 'zzz-test-pytest'
|
156
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
156
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-pytest'
|
157
157
|
Provides-Extra: zzz-test-pytest-regressions
|
158
158
|
Requires-Dist: pytest-regressions<2.8,>=2.7.0; extra == 'zzz-test-pytest-regressions'
|
159
159
|
Provides-Extra: zzz-test-python-dotenv
|
160
160
|
Requires-Dist: python-dotenv<1.2,>=1.1.0; extra == 'zzz-test-python-dotenv'
|
161
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
161
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-python-dotenv'
|
162
162
|
Provides-Extra: zzz-test-random
|
163
163
|
Provides-Extra: zzz-test-re
|
164
164
|
Provides-Extra: zzz-test-redis
|
165
165
|
Requires-Dist: orjson<3.11,>=3.10.15; extra == 'zzz-test-redis'
|
166
|
-
Requires-Dist: polars-lts-cpu<1.
|
166
|
+
Requires-Dist: polars-lts-cpu<1.31,>=1.30.0; extra == 'zzz-test-redis'
|
167
167
|
Requires-Dist: redis<6.2,>=6.1.0; extra == 'zzz-test-redis'
|
168
168
|
Requires-Dist: rich<14.1,>=14.0.0; extra == 'zzz-test-redis'
|
169
169
|
Requires-Dist: tenacity<9.0,>=8.5.0; extra == 'zzz-test-redis'
|
170
170
|
Requires-Dist: tzlocal<5.4,>=5.3.1; extra == 'zzz-test-redis'
|
171
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
171
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-redis'
|
172
172
|
Provides-Extra: zzz-test-rich
|
173
173
|
Requires-Dist: rich<14.1,>=14.0.0; extra == 'zzz-test-rich'
|
174
174
|
Provides-Extra: zzz-test-scipy
|
@@ -191,10 +191,10 @@ Requires-Dist: aiosqlite<0.22,>=0.21.0; extra == 'zzz-test-sqlalchemy-polars'
|
|
191
191
|
Requires-Dist: asyncpg<0.31,>=0.30.0; extra == 'zzz-test-sqlalchemy-polars'
|
192
192
|
Requires-Dist: greenlet<3.3,>=3.2.0; extra == 'zzz-test-sqlalchemy-polars'
|
193
193
|
Requires-Dist: nest-asyncio<1.7,>=1.6.0; extra == 'zzz-test-sqlalchemy-polars'
|
194
|
-
Requires-Dist: polars-lts-cpu<1.
|
194
|
+
Requires-Dist: polars-lts-cpu<1.31,>=1.30.0; extra == 'zzz-test-sqlalchemy-polars'
|
195
195
|
Requires-Dist: sqlalchemy<2.1,>=2.0.41; extra == 'zzz-test-sqlalchemy-polars'
|
196
196
|
Requires-Dist: tenacity<9.0,>=8.5.0; extra == 'zzz-test-sqlalchemy-polars'
|
197
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
197
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-sqlalchemy-polars'
|
198
198
|
Provides-Extra: zzz-test-streamlit
|
199
199
|
Requires-Dist: streamlit<1.46,>=1.45.0; extra == 'zzz-test-streamlit'
|
200
200
|
Provides-Extra: zzz-test-sys
|
@@ -202,7 +202,7 @@ Requires-Dist: atomicwrites<1.5,>=1.4.1; extra == 'zzz-test-sys'
|
|
202
202
|
Requires-Dist: rich<14.1,>=14.0.0; extra == 'zzz-test-sys'
|
203
203
|
Requires-Dist: tomlkit<0.14,>=0.13.2; extra == 'zzz-test-sys'
|
204
204
|
Requires-Dist: tzlocal<5.4,>=5.3.1; extra == 'zzz-test-sys'
|
205
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
205
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-sys'
|
206
206
|
Provides-Extra: zzz-test-tempfile
|
207
207
|
Provides-Extra: zzz-test-tenacity
|
208
208
|
Requires-Dist: tenacity<9.0,>=8.5.0; extra == 'zzz-test-tenacity'
|
@@ -213,11 +213,11 @@ Provides-Extra: zzz-test-traceback
|
|
213
213
|
Requires-Dist: rich<14.1,>=14.0.0; extra == 'zzz-test-traceback'
|
214
214
|
Requires-Dist: tomlkit<0.14,>=0.13.2; extra == 'zzz-test-traceback'
|
215
215
|
Requires-Dist: tzlocal<5.4,>=5.3.1; extra == 'zzz-test-traceback'
|
216
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
216
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-traceback'
|
217
217
|
Provides-Extra: zzz-test-types
|
218
218
|
Provides-Extra: zzz-test-typing
|
219
|
-
Requires-Dist: polars-lts-cpu<1.
|
220
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
219
|
+
Requires-Dist: polars-lts-cpu<1.31,>=1.30.0; extra == 'zzz-test-typing'
|
220
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-typing'
|
221
221
|
Provides-Extra: zzz-test-tzlocal
|
222
222
|
Requires-Dist: tzlocal<5.4,>=5.3.1; extra == 'zzz-test-tzlocal'
|
223
223
|
Provides-Extra: zzz-test-uuid
|
@@ -225,11 +225,11 @@ Provides-Extra: zzz-test-version
|
|
225
225
|
Requires-Dist: tomlkit<0.14,>=0.13.2; extra == 'zzz-test-version'
|
226
226
|
Provides-Extra: zzz-test-warnings
|
227
227
|
Provides-Extra: zzz-test-whenever
|
228
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
228
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-whenever'
|
229
229
|
Provides-Extra: zzz-test-zipfile
|
230
230
|
Provides-Extra: zzz-test-zoneinfo
|
231
231
|
Requires-Dist: tzdata<2025.3,>=2025.2; extra == 'zzz-test-zoneinfo'
|
232
|
-
Requires-Dist: whenever<0.9,>=0.8.
|
232
|
+
Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-zoneinfo'
|
233
233
|
Description-Content-Type: text/markdown
|
234
234
|
|
235
235
|
[](https://badge.fury.io/py/dycw-utilities)
|
@@ -1,7 +1,7 @@
|
|
1
|
-
utilities/__init__.py,sha256=
|
1
|
+
utilities/__init__.py,sha256=Ses6BHZNi0jOdocz8doinXp-udEMKae9OJkWZ9Ptqww,60
|
2
2
|
utilities/altair.py,sha256=Gpja-flOo-Db0PIPJLJsgzAlXWoKUjPU1qY-DQ829ek,9156
|
3
3
|
utilities/astor.py,sha256=xuDUkjq0-b6fhtwjhbnebzbqQZAjMSHR1IIS5uOodVg,777
|
4
|
-
utilities/asyncio.py,sha256=
|
4
|
+
utilities/asyncio.py,sha256=gn8dxBsNzFfFzrNpImF731LAmgLwEQM3uiwKuUPlg08,18822
|
5
5
|
utilities/atomicwrites.py,sha256=geFjn9Pwn-tTrtoGjDDxWli9NqbYfy3gGL6ZBctiqSo,5393
|
6
6
|
utilities/atools.py,sha256=IYMuFSFGSKyuQmqD6v5IUtDlz8PPw0Sr87Cub_gRU3M,1168
|
7
7
|
utilities/cachetools.py,sha256=C1zqOg7BYz0IfQFK8e3qaDDgEZxDpo47F15RTfJM37Q,2910
|
@@ -47,7 +47,7 @@ utilities/pathlib.py,sha256=31WPMXdLIyXgYOMMl_HOI2wlo66MGSE-cgeelk-Lias,1410
|
|
47
47
|
utilities/period.py,sha256=o4wXYEXVlFomop4-Ra4L0yRP4i99NZFjIe_fa7NdZck,11024
|
48
48
|
utilities/pickle.py,sha256=Bhvd7cZl-zQKQDFjUerqGuSKlHvnW1K2QXeU5UZibtg,657
|
49
49
|
utilities/platform.py,sha256=NU7ycTvAXAG-fdYmDXaM1m4EOml2cGiaYwaUzfzSqyU,1767
|
50
|
-
utilities/polars.py,sha256=
|
50
|
+
utilities/polars.py,sha256=tGO3r6S4lFtir6zbdIvZ_kvKBWIha4lnA1eEmV3EvNQ,63632
|
51
51
|
utilities/polars_ols.py,sha256=efhXf0gjrHUpQrvS6a7g8yJQJWf_ATKtJnqqF2inCOU,5680
|
52
52
|
utilities/pqdm.py,sha256=foRytQybmOQ05pjt5LF7ANyzrIa--4ScDE3T2wd31a4,3118
|
53
53
|
utilities/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -78,7 +78,7 @@ utilities/text.py,sha256=Fo12N4aA7k2rnb4W4vH9iiDh88Q5_nvRssTkfNsvVM8,10965
|
|
78
78
|
utilities/threading.py,sha256=GvBOp4CyhHfN90wGXZuA2VKe9fGzMaEa7oCl4f3nnPU,1009
|
79
79
|
utilities/timer.py,sha256=Rkc49KSpHuC8s7vUxGO9DU55U9I6yDKnchsQqrUCVBs,4075
|
80
80
|
utilities/traceback.py,sha256=p9WATV-e4_5AW6SvyRBiU-MY8XnEFcKgrFNUoFzalXI,27521
|
81
|
-
utilities/types.py,sha256=
|
81
|
+
utilities/types.py,sha256=2f1DqTZTMRlpCPWPd9-rh_uwmRPv9UdBoi_Bfv7Ccmo,18374
|
82
82
|
utilities/typing.py,sha256=H6ysJkI830aRwLsMKz0SZIw4cpcsm7d6KhQOwr-SDh0,13817
|
83
83
|
utilities/tzdata.py,sha256=yCf70NICwAeazN3_JcXhWvRqCy06XJNQ42j7r6gw3HY,1217
|
84
84
|
utilities/tzlocal.py,sha256=3upDNFBvGh1l9njmLR2z2S6K6VxQSb7QizYGUbAH3JU,960
|
@@ -88,7 +88,7 @@ utilities/warnings.py,sha256=un1LvHv70PU-LLv8RxPVmugTzDJkkGXRMZTE2-fTQHw,1771
|
|
88
88
|
utilities/whenever.py,sha256=jS31ZAY5OMxFxLja_Yo5Fidi87Pd-GoVZ7Vi_teqVDA,16743
|
89
89
|
utilities/zipfile.py,sha256=24lQc9ATcJxHXBPc_tBDiJk48pWyRrlxO2fIsFxU0A8,699
|
90
90
|
utilities/zoneinfo.py,sha256=-5j7IQ9nb7gR43rdgA7ms05im-XuqhAk9EJnQBXxCoQ,1874
|
91
|
-
dycw_utilities-0.
|
92
|
-
dycw_utilities-0.
|
93
|
-
dycw_utilities-0.
|
94
|
-
dycw_utilities-0.
|
91
|
+
dycw_utilities-0.121.1.dist-info/METADATA,sha256=54NwpwmQD2-MOcByhCWt9vZDiig3pdJSvdA5VmjhNbY,12943
|
92
|
+
dycw_utilities-0.121.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
93
|
+
dycw_utilities-0.121.1.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
|
94
|
+
dycw_utilities-0.121.1.dist-info/RECORD,,
|
utilities/__init__.py
CHANGED
utilities/asyncio.py
CHANGED
@@ -26,7 +26,6 @@ from typing import (
|
|
26
26
|
TYPE_CHECKING,
|
27
27
|
Any,
|
28
28
|
Generic,
|
29
|
-
Literal,
|
30
29
|
NoReturn,
|
31
30
|
TextIO,
|
32
31
|
TypeVar,
|
@@ -49,6 +48,7 @@ from utilities.reprlib import get_repr
|
|
49
48
|
from utilities.sentinel import Sentinel, sentinel
|
50
49
|
from utilities.types import (
|
51
50
|
Coroutine1,
|
51
|
+
DurationOrEveryDuration,
|
52
52
|
MaybeCallableEvent,
|
53
53
|
MaybeType,
|
54
54
|
THashable,
|
@@ -121,17 +121,14 @@ class EnhancedTaskGroup(TaskGroup):
|
|
121
121
|
##
|
122
122
|
|
123
123
|
|
124
|
-
type _DurationOrEvery = Duration | tuple[Literal["every"], Duration]
|
125
|
-
|
126
|
-
|
127
124
|
@dataclass(kw_only=True, unsafe_hash=True)
|
128
125
|
class InfiniteLooper(ABC, Generic[THashable]):
|
129
126
|
"""An infinite loop which can throw exceptions by setting events."""
|
130
127
|
|
131
|
-
sleep_core:
|
132
|
-
sleep_restart:
|
128
|
+
sleep_core: DurationOrEveryDuration = SECOND
|
129
|
+
sleep_restart: DurationOrEveryDuration = MINUTE
|
133
130
|
logger: str | None = None
|
134
|
-
_events: Mapping[THashable, Event] = field(
|
131
|
+
_events: Mapping[THashable | None, Event] = field(
|
135
132
|
default_factory=dict, init=False, repr=False, hash=False
|
136
133
|
)
|
137
134
|
|
@@ -229,7 +226,7 @@ class InfiniteLooper(ABC, Generic[THashable]):
|
|
229
226
|
msgs.append(f"Sleeping {self._sleep_restart_desc}...")
|
230
227
|
getLogger(name=self.logger).error("\n".join(msgs))
|
231
228
|
|
232
|
-
def _raise_error(self, event: THashable, /) -> NoReturn:
|
229
|
+
def _raise_error(self, event: THashable | None, /) -> NoReturn:
|
233
230
|
"""Raise the error corresponding to given event."""
|
234
231
|
mapping = dict(self._yield_events_and_exceptions())
|
235
232
|
error = mapping.get(event, InfiniteLooperError)
|
@@ -241,7 +238,7 @@ class InfiniteLooper(ABC, Generic[THashable]):
|
|
241
238
|
event: Event() for event, _ in self._yield_events_and_exceptions()
|
242
239
|
}
|
243
240
|
|
244
|
-
async def _run_sleep(self, sleep:
|
241
|
+
async def _run_sleep(self, sleep: DurationOrEveryDuration, /) -> None:
|
245
242
|
"""Sleep until the next part of the loop."""
|
246
243
|
match sleep:
|
247
244
|
case int() | float() | dt.timedelta() as duration:
|
@@ -264,12 +261,12 @@ class InfiniteLooper(ABC, Generic[THashable]):
|
|
264
261
|
case _ as never:
|
265
262
|
assert_never(never)
|
266
263
|
|
267
|
-
def _set_event(self, event: THashable
|
264
|
+
def _set_event(self, *, event: THashable | None = None) -> None:
|
268
265
|
"""Set the given event."""
|
269
266
|
try:
|
270
267
|
event_obj = self._events[event]
|
271
268
|
except KeyError:
|
272
|
-
raise
|
269
|
+
raise _InfiniteLooperNoSuchEventError(looper=self, event=event) from None
|
273
270
|
event_obj.set()
|
274
271
|
|
275
272
|
def _yield_coroutines(self) -> Iterator[Callable[[], Coroutine1[None]]]:
|
@@ -278,14 +275,18 @@ class InfiniteLooper(ABC, Generic[THashable]):
|
|
278
275
|
|
279
276
|
def _yield_events_and_exceptions(
|
280
277
|
self,
|
281
|
-
) -> Iterator[tuple[THashable, MaybeType[BaseException]]]:
|
278
|
+
) -> Iterator[tuple[THashable | None, MaybeType[BaseException]]]:
|
282
279
|
"""Yield the events & exceptions."""
|
283
|
-
yield
|
280
|
+
yield (None, _InfiniteLooperDefaultEventError)
|
284
281
|
|
285
282
|
|
286
283
|
@dataclass(kw_only=True, slots=True)
|
287
284
|
class InfiniteLooperError(Exception):
|
288
285
|
looper: InfiniteLooper[Any]
|
286
|
+
|
287
|
+
|
288
|
+
@dataclass(kw_only=True, slots=True)
|
289
|
+
class _InfiniteLooperNoSuchEventError(InfiniteLooperError):
|
289
290
|
event: Hashable
|
290
291
|
|
291
292
|
@override
|
@@ -293,6 +294,13 @@ class InfiniteLooperError(Exception):
|
|
293
294
|
return f"{get_class_name(self.looper)!r} does not have an event {self.event!r}"
|
294
295
|
|
295
296
|
|
297
|
+
@dataclass(kw_only=True, slots=True)
|
298
|
+
class _InfiniteLooperDefaultEventError(InfiniteLooperError):
|
299
|
+
@override
|
300
|
+
def __str__(self) -> str:
|
301
|
+
return f"{get_class_name(self.looper)!r} default event error"
|
302
|
+
|
303
|
+
|
296
304
|
##
|
297
305
|
|
298
306
|
|
utilities/polars.py
CHANGED
@@ -117,7 +117,7 @@ if TYPE_CHECKING:
|
|
117
117
|
JoinStrategy, # pyright: ignore[reportPrivateImportUsage]
|
118
118
|
JoinValidation, # pyright: ignore[reportPrivateImportUsage]
|
119
119
|
PolarsDataType, # pyright: ignore[reportPrivateImportUsage]
|
120
|
-
|
120
|
+
QuantileMethod, # pyright: ignore[reportPrivateImportUsage]
|
121
121
|
SchemaDict, # pyright: ignore[reportPrivateImportUsage]
|
122
122
|
TimeUnit, # pyright: ignore[reportPrivateImportUsage]
|
123
123
|
)
|
@@ -939,7 +939,7 @@ def cross_rolling_quantile(
|
|
939
939
|
quantile: float,
|
940
940
|
/,
|
941
941
|
*,
|
942
|
-
interpolation:
|
942
|
+
interpolation: QuantileMethod = "nearest",
|
943
943
|
window_size: int = 2,
|
944
944
|
weights: list[float] | None = None,
|
945
945
|
min_samples: int | None = None,
|
@@ -952,7 +952,7 @@ def cross_rolling_quantile(
|
|
952
952
|
quantile: float,
|
953
953
|
/,
|
954
954
|
*,
|
955
|
-
interpolation:
|
955
|
+
interpolation: QuantileMethod = "nearest",
|
956
956
|
window_size: int = 2,
|
957
957
|
weights: list[float] | None = None,
|
958
958
|
min_samples: int | None = None,
|
@@ -965,7 +965,7 @@ def cross_rolling_quantile(
|
|
965
965
|
quantile: float,
|
966
966
|
/,
|
967
967
|
*,
|
968
|
-
interpolation:
|
968
|
+
interpolation: QuantileMethod = "nearest",
|
969
969
|
window_size: int = 2,
|
970
970
|
weights: list[float] | None = None,
|
971
971
|
min_samples: int | None = None,
|
@@ -977,7 +977,7 @@ def cross_rolling_quantile(
|
|
977
977
|
quantile: float,
|
978
978
|
/,
|
979
979
|
*,
|
980
|
-
interpolation:
|
980
|
+
interpolation: QuantileMethod = "nearest",
|
981
981
|
window_size: int = 2,
|
982
982
|
weights: list[float] | None = None,
|
983
983
|
min_samples: int | None = None,
|
utilities/types.py
CHANGED
@@ -92,6 +92,7 @@ type DateTimeLike = MaybeStr[dt.datetime]
|
|
92
92
|
type DateOrDateTime = dt.date | dt.datetime
|
93
93
|
type Duration = Number | dt.timedelta
|
94
94
|
type DurationLike = MaybeStr[Duration]
|
95
|
+
type DurationOrEveryDuration = Duration | tuple[Literal["every"], Duration]
|
95
96
|
type MaybeCallableDate = MaybeCallable[dt.date]
|
96
97
|
type MaybeCallableDateTime = MaybeCallable[dt.datetime]
|
97
98
|
type TimeLike = MaybeStr[dt.time]
|
@@ -270,6 +271,7 @@ __all__ = [
|
|
270
271
|
"DateTimeLike",
|
271
272
|
"Duration",
|
272
273
|
"DurationLike",
|
274
|
+
"DurationOrEveryDuration",
|
273
275
|
"EnumLike",
|
274
276
|
"ExcInfo",
|
275
277
|
"IterableHashable",
|
File without changes
|
File without changes
|