dycw-utilities 0.129.10__py3-none-any.whl → 0.175.17__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.175.17.dist-info/METADATA +34 -0
- dycw_utilities-0.175.17.dist-info/RECORD +103 -0
- dycw_utilities-0.175.17.dist-info/WHEEL +4 -0
- dycw_utilities-0.175.17.dist-info/entry_points.txt +4 -0
- utilities/__init__.py +1 -1
- utilities/altair.py +14 -14
- utilities/asyncio.py +350 -819
- utilities/atomicwrites.py +18 -6
- utilities/atools.py +77 -22
- utilities/cachetools.py +24 -29
- utilities/click.py +393 -237
- utilities/concurrent.py +8 -11
- utilities/contextlib.py +216 -17
- utilities/contextvars.py +20 -1
- utilities/cryptography.py +3 -3
- utilities/dataclasses.py +83 -118
- utilities/docker.py +293 -0
- utilities/enum.py +26 -23
- utilities/errors.py +17 -3
- utilities/fastapi.py +29 -65
- utilities/fpdf2.py +3 -3
- utilities/functions.py +169 -416
- utilities/functools.py +18 -19
- utilities/git.py +9 -30
- utilities/grp.py +28 -0
- utilities/gzip.py +31 -0
- utilities/http.py +3 -2
- utilities/hypothesis.py +738 -589
- utilities/importlib.py +17 -1
- utilities/inflect.py +25 -0
- utilities/iterables.py +194 -262
- utilities/jinja2.py +148 -0
- utilities/json.py +70 -0
- utilities/libcst.py +38 -17
- utilities/lightweight_charts.py +5 -9
- utilities/logging.py +345 -543
- utilities/math.py +18 -13
- utilities/memory_profiler.py +11 -15
- utilities/more_itertools.py +200 -131
- utilities/operator.py +33 -29
- utilities/optuna.py +6 -6
- utilities/orjson.py +272 -137
- utilities/os.py +61 -4
- utilities/parse.py +59 -61
- utilities/pathlib.py +281 -40
- utilities/permissions.py +298 -0
- utilities/pickle.py +2 -2
- utilities/platform.py +24 -5
- utilities/polars.py +1214 -430
- utilities/polars_ols.py +1 -1
- utilities/postgres.py +408 -0
- utilities/pottery.py +113 -26
- utilities/pqdm.py +10 -11
- utilities/psutil.py +6 -57
- utilities/pwd.py +28 -0
- utilities/pydantic.py +4 -54
- utilities/pydantic_settings.py +240 -0
- utilities/pydantic_settings_sops.py +76 -0
- utilities/pyinstrument.py +8 -10
- utilities/pytest.py +227 -121
- utilities/pytest_plugins/__init__.py +1 -0
- utilities/pytest_plugins/pytest_randomly.py +23 -0
- utilities/pytest_plugins/pytest_regressions.py +56 -0
- utilities/pytest_regressions.py +26 -46
- utilities/random.py +13 -9
- utilities/re.py +58 -28
- utilities/redis.py +401 -550
- utilities/scipy.py +1 -1
- utilities/sentinel.py +10 -0
- utilities/shelve.py +4 -1
- utilities/shutil.py +25 -0
- utilities/slack_sdk.py +36 -106
- utilities/sqlalchemy.py +502 -473
- utilities/sqlalchemy_polars.py +38 -94
- utilities/string.py +2 -3
- utilities/subprocess.py +1572 -0
- utilities/tempfile.py +86 -4
- utilities/testbook.py +50 -0
- utilities/text.py +165 -42
- utilities/timer.py +37 -65
- utilities/traceback.py +158 -929
- utilities/types.py +146 -116
- utilities/typing.py +531 -71
- utilities/tzdata.py +1 -53
- utilities/tzlocal.py +6 -23
- utilities/uuid.py +43 -5
- utilities/version.py +27 -26
- utilities/whenever.py +1776 -386
- utilities/zoneinfo.py +84 -22
- dycw_utilities-0.129.10.dist-info/METADATA +0 -241
- dycw_utilities-0.129.10.dist-info/RECORD +0 -96
- dycw_utilities-0.129.10.dist-info/WHEEL +0 -4
- dycw_utilities-0.129.10.dist-info/licenses/LICENSE +0 -21
- utilities/datetime.py +0 -1409
- utilities/eventkit.py +0 -402
- utilities/loguru.py +0 -144
- utilities/luigi.py +0 -228
- utilities/period.py +0 -324
- utilities/pyrsistent.py +0 -89
- utilities/python_dotenv.py +0 -105
- utilities/streamlit.py +0 -105
- utilities/sys.py +0 -87
- utilities/tenacity.py +0 -145
utilities/types.py
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import datetime as dt
|
|
4
|
-
from
|
|
5
|
-
from collections.abc import Awaitable, Callable, Coroutine, Hashable, Iterable, Mapping
|
|
4
|
+
from collections.abc import Callable, Collection, Coroutine, Iterable, Mapping
|
|
6
5
|
from enum import Enum
|
|
6
|
+
from ipaddress import IPv4Address, IPv6Address
|
|
7
7
|
from logging import Logger
|
|
8
8
|
from pathlib import Path
|
|
9
9
|
from random import Random
|
|
10
|
+
from re import Pattern
|
|
10
11
|
from types import TracebackType
|
|
11
12
|
from typing import (
|
|
12
13
|
Any,
|
|
@@ -14,11 +15,26 @@ from typing import (
|
|
|
14
15
|
Literal,
|
|
15
16
|
Protocol,
|
|
16
17
|
TypeVar,
|
|
18
|
+
get_args,
|
|
17
19
|
overload,
|
|
18
20
|
runtime_checkable,
|
|
19
21
|
)
|
|
22
|
+
from uuid import UUID
|
|
20
23
|
from zoneinfo import ZoneInfo
|
|
21
24
|
|
|
25
|
+
from whenever import (
|
|
26
|
+
Date,
|
|
27
|
+
DateDelta,
|
|
28
|
+
DateTimeDelta,
|
|
29
|
+
MonthDay,
|
|
30
|
+
PlainDateTime,
|
|
31
|
+
Time,
|
|
32
|
+
TimeDelta,
|
|
33
|
+
YearMonth,
|
|
34
|
+
ZonedDateTime,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
_T = TypeVar("_T")
|
|
22
38
|
_T_co = TypeVar("_T_co", covariant=True)
|
|
23
39
|
_T_contra = TypeVar("_T_contra", contravariant=True)
|
|
24
40
|
|
|
@@ -46,29 +62,31 @@ type OpenMode = Literal[
|
|
|
46
62
|
"x+b",
|
|
47
63
|
"a+b",
|
|
48
64
|
]
|
|
49
|
-
type MaybeCallable[
|
|
50
|
-
type MaybeStr[
|
|
51
|
-
type MaybeType[
|
|
65
|
+
type MaybeCallable[T] = T | Callable[[], T]
|
|
66
|
+
type MaybeStr[T] = T | str
|
|
67
|
+
type MaybeType[T] = T | type[T]
|
|
52
68
|
type StrMapping = Mapping[str, Any]
|
|
53
69
|
type StrStrMapping = Mapping[str, str]
|
|
54
|
-
type TypeLike[_T] = type[_T] | tuple[type[_T], ...]
|
|
55
70
|
type TupleOrStrMapping = tuple[Any, ...] | StrMapping
|
|
71
|
+
type TypeLike[T] = type[T] | tuple[type[T], ...]
|
|
72
|
+
# basic - derived
|
|
73
|
+
type MaybeCallableBoolLike = MaybeCallable[BoolLike]
|
|
74
|
+
type BoolLike = MaybeStr[bool]
|
|
56
75
|
|
|
57
76
|
|
|
58
77
|
# asyncio
|
|
59
|
-
type
|
|
60
|
-
type
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
)
|
|
78
|
+
type Coro[T] = Coroutine[Any, Any, T]
|
|
79
|
+
type MaybeCoro[T] = T | Coro[T]
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
# collections.abc
|
|
83
|
+
type SupportsFloatOrIndex = SupportsFloat | SupportsIndex
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
@runtime_checkable
|
|
87
|
+
class SupportsKeysAndGetItem(Protocol[_T, _T_co]):
|
|
88
|
+
def keys(self) -> Iterable[_T]: ... # pragma: no cover
|
|
89
|
+
def __getitem__(self, key: _T, /) -> _T_co: ... # pragma: no cover
|
|
72
90
|
|
|
73
91
|
|
|
74
92
|
# concurrent
|
|
@@ -83,56 +101,46 @@ class Dataclass(Protocol):
|
|
|
83
101
|
__dataclass_fields__: ClassVar[dict[str, Any]]
|
|
84
102
|
|
|
85
103
|
|
|
86
|
-
TDataclass = TypeVar("TDataclass", bound=Dataclass)
|
|
87
|
-
|
|
88
|
-
|
|
89
104
|
# datetime
|
|
90
|
-
type
|
|
91
|
-
type DateTimeLike = MaybeStr[dt.datetime]
|
|
92
|
-
type DateOrDateTime = dt.date | dt.datetime
|
|
93
|
-
type Duration = Number | dt.timedelta
|
|
94
|
-
type DurationLike = MaybeStr[Duration]
|
|
95
|
-
type DurationOrEveryDuration = Duration | tuple[Literal["every"], Duration]
|
|
96
|
-
type MaybeCallableDate = MaybeCallable[dt.date]
|
|
97
|
-
type MaybeCallableDateTime = MaybeCallable[dt.datetime]
|
|
98
|
-
type TimeLike = MaybeStr[dt.time]
|
|
99
|
-
type TimeDeltaLike = MaybeStr[dt.timedelta]
|
|
100
|
-
type WeekDay = Literal["mon", "tue", "wed", "thu", "fri", "sat", "sun"]
|
|
105
|
+
type MonthInt = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
|
|
101
106
|
|
|
102
107
|
|
|
103
108
|
# enum
|
|
104
|
-
type EnumLike[
|
|
105
|
-
TEnum = TypeVar("TEnum", bound=Enum)
|
|
109
|
+
type EnumLike[E: Enum] = MaybeStr[E]
|
|
106
110
|
|
|
107
111
|
|
|
108
|
-
#
|
|
109
|
-
|
|
112
|
+
# errors
|
|
113
|
+
type ExceptionTypeLike[T: Exception] = type[T] | tuple[type[T], ...]
|
|
110
114
|
|
|
111
115
|
|
|
112
|
-
#
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
THashable2 = TypeVar("THashable2", bound=Hashable)
|
|
116
|
+
# ipaddress
|
|
117
|
+
IPv4AddressLike = MaybeStr[IPv4Address]
|
|
118
|
+
IPv6AddressLike = MaybeStr[IPv6Address]
|
|
116
119
|
|
|
117
120
|
|
|
118
121
|
# iterables
|
|
119
|
-
type
|
|
120
|
-
type
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
type
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
type MaybeCollection[T] = T | Collection[T]
|
|
123
|
+
type MaybeIterable[T] = T | Iterable[T]
|
|
124
|
+
type MaybeList[T] = T | list[T]
|
|
125
|
+
type MaybeSet[T] = T | set[T] | frozenset[T]
|
|
126
|
+
type SequenceLT[T] = list[T] | tuple[T, ...]
|
|
127
|
+
# iterables - dervied
|
|
128
|
+
type MaybeSequence[T] = T | SequenceLT[T]
|
|
129
|
+
type SequenceStr = SequenceLT[str]
|
|
130
|
+
type CollectionStr = dict[str, Any] | frozenset[str] | set[str] | SequenceStr
|
|
131
|
+
# iterables - maybe str
|
|
132
|
+
type MaybeCollectionStr = str | CollectionStr
|
|
133
|
+
type MaybeSequenceStr = str | SequenceStr
|
|
126
134
|
|
|
127
135
|
|
|
128
136
|
# logging
|
|
129
137
|
type LogLevel = Literal["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]
|
|
130
|
-
type
|
|
138
|
+
type LoggerLike = MaybeStr[Logger]
|
|
131
139
|
|
|
132
140
|
|
|
133
141
|
# math
|
|
134
142
|
type Number = int | float
|
|
135
|
-
type
|
|
143
|
+
type MathRoundMode = Literal[
|
|
136
144
|
"standard",
|
|
137
145
|
"floor",
|
|
138
146
|
"ceil",
|
|
@@ -154,77 +162,47 @@ class SupportsAbs(Protocol[_T_co]):
|
|
|
154
162
|
def __abs__(self) -> _T_co: ... # pragma: no cover
|
|
155
163
|
|
|
156
164
|
|
|
157
|
-
TSupportsAbs = TypeVar("TSupportsAbs", bound=SupportsAbs)
|
|
158
|
-
|
|
159
|
-
|
|
160
165
|
@runtime_checkable
|
|
161
166
|
class SupportsAdd(Protocol[_T_contra, _T_co]):
|
|
162
167
|
def __add__(self, x: _T_contra, /) -> _T_co: ... # pragma: no cover
|
|
163
168
|
|
|
164
169
|
|
|
165
|
-
TSupportsAdd = TypeVar("TSupportsAdd", bound=SupportsAdd)
|
|
166
|
-
|
|
167
|
-
|
|
168
170
|
@runtime_checkable
|
|
169
171
|
class SupportsBytes(Protocol):
|
|
170
172
|
def __bytes__(self) -> bytes: ... # pragma: no cover
|
|
171
173
|
|
|
172
174
|
|
|
173
|
-
TSupportsBytes = TypeVar("TSupportsBytes", bound=SupportsBytes)
|
|
174
|
-
|
|
175
|
-
|
|
176
175
|
@runtime_checkable
|
|
177
176
|
class SupportsComplex(Protocol):
|
|
178
177
|
def __complex__(self) -> complex: ... # pragma: no cover
|
|
179
178
|
|
|
180
179
|
|
|
181
|
-
TSupportsComplex = TypeVar("TSupportsComplex", bound=SupportsComplex)
|
|
182
|
-
|
|
183
|
-
|
|
184
180
|
@runtime_checkable
|
|
185
181
|
class SupportsFloat(Protocol):
|
|
186
182
|
def __float__(self) -> float: ... # pragma: no cover
|
|
187
183
|
|
|
188
184
|
|
|
189
|
-
TSupportsFloat = TypeVar("TSupportsFloat", bound=SupportsFloat)
|
|
190
|
-
|
|
191
|
-
|
|
192
185
|
@runtime_checkable
|
|
193
186
|
class SupportsGT(Protocol[_T_contra]):
|
|
194
187
|
def __gt__(self, other: _T_contra, /) -> bool: ... # pragma: no cover
|
|
195
188
|
|
|
196
189
|
|
|
197
|
-
TSupportsGT = TypeVar("TSupportsGT", bound=SupportsGT)
|
|
198
|
-
|
|
199
|
-
|
|
200
190
|
@runtime_checkable
|
|
201
191
|
class SupportsIndex(Protocol):
|
|
202
192
|
def __index__(self) -> int: ... # pragma: no cover
|
|
203
193
|
|
|
204
194
|
|
|
205
|
-
TSupportsIndex = TypeVar("TSupportsIndex", bound=SupportsIndex)
|
|
206
|
-
|
|
207
|
-
|
|
208
195
|
@runtime_checkable
|
|
209
196
|
class SupportsInt(Protocol):
|
|
210
197
|
def __int__(self) -> int: ... # pragma: no cover
|
|
211
198
|
|
|
212
199
|
|
|
213
|
-
TSupportsInt = TypeVar("TSupportsInt", bound=SupportsInt)
|
|
214
|
-
|
|
215
|
-
|
|
216
200
|
@runtime_checkable
|
|
217
201
|
class SupportsLT(Protocol[_T_contra]):
|
|
218
202
|
def __lt__(self, other: _T_contra, /) -> bool: ... # pragma: no cover
|
|
219
203
|
|
|
220
204
|
|
|
221
|
-
TSupportsLT = TypeVar("TSupportsLT", bound=SupportsLT)
|
|
222
|
-
|
|
223
|
-
|
|
224
205
|
SupportsRichComparison = SupportsLT[Any] | SupportsGT[Any]
|
|
225
|
-
TSupportsRichComparison = TypeVar(
|
|
226
|
-
"TSupportsRichComparison", bound=SupportsRichComparison
|
|
227
|
-
)
|
|
228
206
|
|
|
229
207
|
|
|
230
208
|
@runtime_checkable
|
|
@@ -241,61 +219,126 @@ type SerializeObjectExtra = Mapping[Any, Callable[[Any], str]]
|
|
|
241
219
|
|
|
242
220
|
|
|
243
221
|
# pathlib
|
|
244
|
-
type MaybeCallablePathLike = MaybeCallable[PathLike]
|
|
245
222
|
type PathLike = MaybeStr[Path]
|
|
223
|
+
type MaybeCallablePathLike = MaybeCallable[PathLike]
|
|
246
224
|
|
|
247
225
|
|
|
248
226
|
# random
|
|
249
227
|
type Seed = int | float | str | bytes | bytearray | Random
|
|
250
228
|
|
|
251
229
|
|
|
230
|
+
# re
|
|
231
|
+
type PatternLike = MaybeStr[Pattern[str]]
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
# retry
|
|
235
|
+
type Retry = tuple[int, Delta | None]
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
# text
|
|
239
|
+
type MaybeCallableStr = MaybeCallable[str]
|
|
240
|
+
|
|
241
|
+
|
|
252
242
|
# traceback
|
|
253
243
|
type ExcInfo = tuple[type[BaseException], BaseException, TracebackType]
|
|
254
244
|
type OptExcInfo = ExcInfo | tuple[None, None, None]
|
|
255
245
|
|
|
256
246
|
|
|
247
|
+
# uuid
|
|
248
|
+
type UUIDLike = MaybeStr[UUID]
|
|
249
|
+
type MaybeCallableUUIDLike = MaybeCallable[UUIDLike | Seed]
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
# whenever
|
|
253
|
+
type DateDeltaLike = MaybeStr[DateDelta]
|
|
254
|
+
type DateLike = MaybeStr[Date]
|
|
255
|
+
type DateOrDateTimeDelta = DateDelta | DateTimeDelta
|
|
256
|
+
type DateTimeDeltaLike = MaybeStr[DateTimeDelta]
|
|
257
|
+
type DateTimeRoundMode = Literal[
|
|
258
|
+
"ceil", "floor", "half_ceil", "half_floor", "half_even"
|
|
259
|
+
]
|
|
260
|
+
type Delta = DateDelta | TimeDelta | DateTimeDelta
|
|
261
|
+
type MaybeCallableDateLike = MaybeCallable[DateLike]
|
|
262
|
+
type MaybeCallableTimeLike = MaybeCallable[TimeLike]
|
|
263
|
+
type MaybeCallableZonedDateTimeLike = MaybeCallable[ZonedDateTimeLike]
|
|
264
|
+
type MonthDayLike = MaybeStr[MonthDay]
|
|
265
|
+
type PlainDateTimeLike = MaybeStr[PlainDateTime]
|
|
266
|
+
type TimeDeltaLike = MaybeStr[TimeDelta]
|
|
267
|
+
type TimeLike = MaybeStr[Time]
|
|
268
|
+
type TimeOrDateTimeDelta = TimeDelta | DateTimeDelta
|
|
269
|
+
type WeekDay = Literal["mon", "tue", "wed", "thu", "fri", "sat", "sun"]
|
|
270
|
+
type YearMonthLike = MaybeStr[YearMonth]
|
|
271
|
+
type ZonedDateTimeLike = MaybeStr[ZonedDateTime]
|
|
272
|
+
|
|
273
|
+
|
|
257
274
|
# zoneinfo
|
|
258
275
|
# fmt: off
|
|
259
276
|
type TimeZone = Literal[
|
|
260
277
|
"Africa/Abidjan", "Africa/Accra", "Africa/Addis_Ababa", "Africa/Algiers", "Africa/Asmara", "Africa/Asmera", "Africa/Bamako", "Africa/Bangui", "Africa/Banjul", "Africa/Bissau", "Africa/Blantyre", "Africa/Brazzaville", "Africa/Bujumbura", "Africa/Cairo", "Africa/Casablanca", "Africa/Ceuta", "Africa/Conakry", "Africa/Dakar", "Africa/Dar_es_Salaam", "Africa/Djibouti", "Africa/Douala", "Africa/El_Aaiun", "Africa/Freetown", "Africa/Gaborone", "Africa/Harare", "Africa/Johannesburg", "Africa/Juba", "Africa/Kampala", "Africa/Khartoum", "Africa/Kigali", "Africa/Kinshasa", "Africa/Lagos", "Africa/Libreville", "Africa/Lome", "Africa/Luanda", "Africa/Lubumbashi", "Africa/Lusaka", "Africa/Malabo", "Africa/Maputo", "Africa/Maseru", "Africa/Mbabane", "Africa/Mogadishu", "Africa/Monrovia", "Africa/Nairobi", "Africa/Ndjamena", "Africa/Niamey", "Africa/Nouakchott", "Africa/Ouagadougou", "Africa/Porto-Novo", "Africa/Sao_Tome", "Africa/Timbuktu", "Africa/Tripoli", "Africa/Tunis", "Africa/Windhoek", "America/Adak", "America/Anchorage", "America/Anguilla", "America/Antigua", "America/Araguaina", "America/Argentina/Buenos_Aires", "America/Argentina/Catamarca", "America/Argentina/ComodRivadavia", "America/Argentina/Cordoba", "America/Argentina/Jujuy", "America/Argentina/La_Rioja", "America/Argentina/Mendoza", "America/Argentina/Rio_Gallegos", "America/Argentina/Salta", "America/Argentina/San_Juan", "America/Argentina/San_Luis", "America/Argentina/Tucuman", "America/Argentina/Ushuaia", "America/Aruba", "America/Asuncion", "America/Atikokan", "America/Atka", "America/Bahia", "America/Bahia_Banderas", "America/Barbados", "America/Belem", "America/Belize", "America/Blanc-Sablon", "America/Boa_Vista", "America/Bogota", "America/Boise", "America/Buenos_Aires", "America/Cambridge_Bay", "America/Campo_Grande", "America/Cancun", "America/Caracas", "America/Catamarca", "America/Cayenne", "America/Cayman", "America/Chicago", "America/Chihuahua", "America/Ciudad_Juarez", "America/Coral_Harbour", "America/Cordoba", "America/Costa_Rica", "America/Coyhaique", "America/Creston", "America/Cuiaba", "America/Curacao", "America/Danmarkshavn", "America/Dawson", "America/Dawson_Creek", "America/Denver", "America/Detroit", "America/Dominica", "America/Edmonton", "America/Eirunepe", "America/El_Salvador", "America/Ensenada", "America/Fort_Nelson", "America/Fort_Wayne", "America/Fortaleza", "America/Glace_Bay", "America/Godthab", "America/Goose_Bay", "America/Grand_Turk", "America/Grenada", "America/Guadeloupe", "America/Guatemala", "America/Guayaquil", "America/Guyana", "America/Halifax", "America/Havana", "America/Hermosillo", "America/Indiana/Indianapolis", "America/Indiana/Knox", "America/Indiana/Marengo", "America/Indiana/Petersburg", "America/Indiana/Tell_City", "America/Indiana/Vevay", "America/Indiana/Vincennes", "America/Indiana/Winamac", "America/Indianapolis", "America/Inuvik", "America/Iqaluit", "America/Jamaica", "America/Jujuy", "America/Juneau", "America/Kentucky/Louisville", "America/Kentucky/Monticello", "America/Knox_IN", "America/Kralendijk", "America/La_Paz", "America/Lima", "America/Los_Angeles", "America/Louisville", "America/Lower_Princes", "America/Maceio", "America/Managua", "America/Manaus", "America/Marigot", "America/Martinique", "America/Matamoros", "America/Mazatlan", "America/Mendoza", "America/Menominee", "America/Merida", "America/Metlakatla", "America/Mexico_City", "America/Miquelon", "America/Moncton", "America/Monterrey", "America/Montevideo", "America/Montreal", "America/Montserrat", "America/Nassau", "America/New_York", "America/Nipigon", "America/Nome", "America/Noronha", "America/North_Dakota/Beulah", "America/North_Dakota/Center", "America/North_Dakota/New_Salem", "America/Nuuk", "America/Ojinaga", "America/Panama", "America/Pangnirtung", "America/Paramaribo", "America/Phoenix", "America/Port-au-Prince", "America/Port_of_Spain", "America/Porto_Acre", "America/Porto_Velho", "America/Puerto_Rico", "America/Punta_Arenas", "America/Rainy_River", "America/Rankin_Inlet", "America/Recife", "America/Regina", "America/Resolute", "America/Rio_Branco", "America/Rosario", "America/Santa_Isabel", "America/Santarem", "America/Santiago", "America/Santo_Domingo", "America/Sao_Paulo", "America/Scoresbysund", "America/Shiprock", "America/Sitka", "America/St_Barthelemy", "America/St_Johns", "America/St_Kitts", "America/St_Lucia", "America/St_Thomas", "America/St_Vincent", "America/Swift_Current", "America/Tegucigalpa", "America/Thule", "America/Thunder_Bay", "America/Tijuana", "America/Toronto", "America/Tortola", "America/Vancouver", "America/Virgin", "America/Whitehorse", "America/Winnipeg", "America/Yakutat", "America/Yellowknife", "Antarctica/Casey", "Antarctica/Davis", "Antarctica/DumontDUrville", "Antarctica/Macquarie", "Antarctica/Mawson", "Antarctica/McMurdo", "Antarctica/Palmer", "Antarctica/Rothera", "Antarctica/South_Pole", "Antarctica/Syowa", "Antarctica/Troll", "Antarctica/Vostok", "Arctic/Longyearbyen", "Asia/Aden", "Asia/Almaty", "Asia/Amman", "Asia/Anadyr", "Asia/Aqtau", "Asia/Aqtobe", "Asia/Ashgabat", "Asia/Ashkhabad", "Asia/Atyrau", "Asia/Baghdad", "Asia/Bahrain", "Asia/Baku", "Asia/Bangkok", "Asia/Barnaul", "Asia/Beirut", "Asia/Bishkek", "Asia/Brunei", "Asia/Calcutta", "Asia/Chita", "Asia/Choibalsan", "Asia/Chongqing", "Asia/Chungking", "Asia/Colombo", "Asia/Dacca", "Asia/Damascus", "Asia/Dhaka", "Asia/Dili", "Asia/Dubai", "Asia/Dushanbe", "Asia/Famagusta", "Asia/Gaza", "Asia/Harbin", "Asia/Hebron", "Asia/Ho_Chi_Minh", "Asia/Hong_Kong", "Asia/Hovd", "Asia/Irkutsk", "Asia/Istanbul", "Asia/Jakarta", "Asia/Jayapura", "Asia/Jerusalem", "Asia/Kabul", "Asia/Kamchatka", "Asia/Karachi", "Asia/Kashgar", "Asia/Kathmandu", "Asia/Katmandu", "Asia/Khandyga", "Asia/Kolkata", "Asia/Krasnoyarsk", "Asia/Kuala_Lumpur", "Asia/Kuching", "Asia/Kuwait", "Asia/Macao", "Asia/Macau", "Asia/Magadan", "Asia/Makassar", "Asia/Manila", "Asia/Muscat", "Asia/Nicosia", "Asia/Novokuznetsk", "Asia/Novosibirsk", "Asia/Omsk", "Asia/Oral", "Asia/Phnom_Penh", "Asia/Pontianak", "Asia/Pyongyang", "Asia/Qatar", "Asia/Qostanay", "Asia/Qyzylorda", "Asia/Rangoon", "Asia/Riyadh", "Asia/Saigon", "Asia/Sakhalin", "Asia/Samarkand", "Asia/Seoul", "Asia/Shanghai", "Asia/Singapore", "Asia/Srednekolymsk", "Asia/Taipei", "Asia/Tashkent", "Asia/Tbilisi", "Asia/Tehran", "Asia/Tel_Aviv", "Asia/Thimbu", "Asia/Thimphu", "Asia/Tokyo", "Asia/Tomsk", "Asia/Ujung_Pandang", "Asia/Ulaanbaatar", "Asia/Ulan_Bator", "Asia/Urumqi", "Asia/Ust-Nera", "Asia/Vientiane", "Asia/Vladivostok", "Asia/Yakutsk", "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Atlantic/Azores", "Atlantic/Bermuda", "Atlantic/Canary", "Atlantic/Cape_Verde", "Atlantic/Faeroe", "Atlantic/Faroe", "Atlantic/Jan_Mayen", "Atlantic/Madeira", "Atlantic/Reykjavik", "Atlantic/South_Georgia", "Atlantic/St_Helena", "Atlantic/Stanley", "Australia/ACT", "Australia/Adelaide", "Australia/Brisbane", "Australia/Broken_Hill", "Australia/Canberra", "Australia/Currie", "Australia/Darwin", "Australia/Eucla", "Australia/Hobart", "Australia/LHI", "Australia/Lindeman", "Australia/Lord_Howe", "Australia/Melbourne", "Australia/NSW", "Australia/North", "Australia/Perth", "Australia/Queensland", "Australia/South", "Australia/Sydney", "Australia/Tasmania", "Australia/Victoria", "Australia/West", "Australia/Yancowinna", "Brazil/Acre", "Brazil/DeNoronha", "Brazil/East", "Brazil/West", "CET", "CST6CDT", "Canada/Atlantic", "Canada/Central", "Canada/Eastern", "Canada/Mountain", "Canada/Newfoundland", "Canada/Pacific", "Canada/Saskatchewan", "Canada/Yukon", "Chile/Continental", "Chile/EasterIsland", "Cuba", "EET", "EST", "EST5EDT", "Egypt", "Eire", "Etc/GMT", "Etc/GMT+0", "Etc/GMT+1", "Etc/GMT+10", "Etc/GMT+11", "Etc/GMT+12", "Etc/GMT+2", "Etc/GMT+3", "Etc/GMT+4", "Etc/GMT+5", "Etc/GMT+6", "Etc/GMT+7", "Etc/GMT+8", "Etc/GMT+9", "Etc/GMT-0", "Etc/GMT-1", "Etc/GMT-10", "Etc/GMT-11", "Etc/GMT-12", "Etc/GMT-13", "Etc/GMT-14", "Etc/GMT-2", "Etc/GMT-3", "Etc/GMT-4", "Etc/GMT-5", "Etc/GMT-6", "Etc/GMT-7", "Etc/GMT-8", "Etc/GMT-9", "Etc/GMT0", "Etc/Greenwich", "Etc/UCT", "Etc/UTC", "Etc/Universal", "Etc/Zulu", "Europe/Amsterdam", "Europe/Andorra", "Europe/Astrakhan", "Europe/Athens", "Europe/Belfast", "Europe/Belgrade", "Europe/Berlin", "Europe/Bratislava", "Europe/Brussels", "Europe/Bucharest", "Europe/Budapest", "Europe/Busingen", "Europe/Chisinau", "Europe/Copenhagen", "Europe/Dublin", "Europe/Gibraltar", "Europe/Guernsey", "Europe/Helsinki", "Europe/Isle_of_Man", "Europe/Istanbul", "Europe/Jersey", "Europe/Kaliningrad", "Europe/Kiev", "Europe/Kirov", "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", "Europe/Luxembourg", "Europe/Madrid", "Europe/Malta", "Europe/Mariehamn", "Europe/Minsk", "Europe/Monaco", "Europe/Moscow", "Europe/Nicosia", "Europe/Oslo", "Europe/Paris", "Europe/Podgorica", "Europe/Prague", "Europe/Riga", "Europe/Rome", "Europe/Samara", "Europe/San_Marino", "Europe/Sarajevo", "Europe/Saratov", "Europe/Simferopol", "Europe/Skopje", "Europe/Sofia", "Europe/Stockholm", "Europe/Tallinn", "Europe/Tirane", "Europe/Tiraspol", "Europe/Ulyanovsk", "Europe/Uzhgorod", "Europe/Vaduz", "Europe/Vatican", "Europe/Vienna", "Europe/Vilnius", "Europe/Volgograd", "Europe/Warsaw", "Europe/Zagreb", "Europe/Zaporozhye", "Europe/Zurich", "Factory", "GB", "GB-Eire", "GMT", "GMT+0", "GMT-0", "GMT0", "Greenwich", "HST", "Hongkong", "Iceland", "Indian/Antananarivo", "Indian/Chagos", "Indian/Christmas", "Indian/Cocos", "Indian/Comoro", "Indian/Kerguelen", "Indian/Mahe", "Indian/Maldives", "Indian/Mauritius", "Indian/Mayotte", "Indian/Reunion", "Iran", "Israel", "Jamaica", "Japan", "Kwajalein", "Libya", "MET", "MST", "MST7MDT", "Mexico/BajaNorte", "Mexico/BajaSur", "Mexico/General", "NZ", "NZ-CHAT", "Navajo", "PRC", "PST8PDT", "Pacific/Apia", "Pacific/Auckland", "Pacific/Bougainville", "Pacific/Chatham", "Pacific/Chuuk", "Pacific/Easter", "Pacific/Efate", "Pacific/Enderbury", "Pacific/Fakaofo", "Pacific/Fiji", "Pacific/Funafuti", "Pacific/Galapagos", "Pacific/Gambier", "Pacific/Guadalcanal", "Pacific/Guam", "Pacific/Honolulu", "Pacific/Johnston", "Pacific/Kanton", "Pacific/Kiritimati", "Pacific/Kosrae", "Pacific/Kwajalein", "Pacific/Majuro", "Pacific/Marquesas", "Pacific/Midway", "Pacific/Nauru", "Pacific/Niue", "Pacific/Norfolk", "Pacific/Noumea", "Pacific/Pago_Pago", "Pacific/Palau", "Pacific/Pitcairn", "Pacific/Pohnpei", "Pacific/Ponape", "Pacific/Port_Moresby", "Pacific/Rarotonga", "Pacific/Saipan", "Pacific/Samoa", "Pacific/Tahiti", "Pacific/Tarawa", "Pacific/Tongatapu", "Pacific/Truk", "Pacific/Wake", "Pacific/Wallis", "Pacific/Yap", "Poland", "Portugal", "ROC", "ROK", "Singapore", "Turkey", "UCT", "US/Alaska", "US/Aleutian", "US/Arizona", "US/Central", "US/East-Indiana", "US/Eastern", "US/Hawaii", "US/Indiana-Starke", "US/Michigan", "US/Mountain", "US/Pacific", "US/Samoa", "UTC", "Universal", "W-SU", "WET", "Zulu"
|
|
261
278
|
]
|
|
262
279
|
# fmt: on
|
|
263
|
-
|
|
280
|
+
TIME_ZONES: list[TimeZone] = list(get_args(TimeZone.__value__))
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
type TimeZoneLike = (
|
|
284
|
+
ZoneInfo
|
|
285
|
+
| ZonedDateTime
|
|
286
|
+
| Literal["local", "localtime"]
|
|
287
|
+
| TimeZone
|
|
288
|
+
| dt.tzinfo
|
|
289
|
+
| dt.datetime
|
|
290
|
+
)
|
|
264
291
|
|
|
265
292
|
|
|
266
293
|
__all__ = [
|
|
267
|
-
"
|
|
294
|
+
"TIME_ZONES",
|
|
295
|
+
"Coro",
|
|
268
296
|
"Dataclass",
|
|
297
|
+
"DateDeltaLike",
|
|
269
298
|
"DateLike",
|
|
270
|
-
"
|
|
271
|
-
"
|
|
272
|
-
"
|
|
273
|
-
"
|
|
274
|
-
"DurationOrEveryDuration",
|
|
299
|
+
"DateOrDateTimeDelta",
|
|
300
|
+
"DateTimeDeltaLike",
|
|
301
|
+
"DateTimeRoundMode",
|
|
302
|
+
"Delta",
|
|
275
303
|
"EnumLike",
|
|
276
304
|
"ExcInfo",
|
|
277
|
-
"
|
|
305
|
+
"ExceptionTypeLike",
|
|
306
|
+
"IPv4AddressLike",
|
|
307
|
+
"IPv6AddressLike",
|
|
278
308
|
"LogLevel",
|
|
279
|
-
"
|
|
280
|
-
"
|
|
309
|
+
"LoggerLike",
|
|
310
|
+
"MathRoundMode",
|
|
281
311
|
"MaybeCallable",
|
|
282
|
-
"
|
|
283
|
-
"
|
|
284
|
-
"MaybeCallableEvent",
|
|
312
|
+
"MaybeCallableBoolLike",
|
|
313
|
+
"MaybeCallableDateLike",
|
|
285
314
|
"MaybeCallablePathLike",
|
|
286
|
-
"
|
|
315
|
+
"MaybeCallableStr",
|
|
316
|
+
"MaybeCallableTimeLike",
|
|
317
|
+
"MaybeCallableUUIDLike",
|
|
318
|
+
"MaybeCallableZonedDateTimeLike",
|
|
319
|
+
"MaybeCollection",
|
|
320
|
+
"MaybeCollectionStr",
|
|
321
|
+
"MaybeCoro",
|
|
287
322
|
"MaybeIterable",
|
|
288
|
-
"
|
|
323
|
+
"MaybeList",
|
|
324
|
+
"MaybeSequence",
|
|
325
|
+
"MaybeSequenceStr",
|
|
326
|
+
"MaybeSet",
|
|
289
327
|
"MaybeStr",
|
|
290
328
|
"MaybeType",
|
|
329
|
+
"MonthDayLike",
|
|
330
|
+
"MonthInt",
|
|
291
331
|
"Number",
|
|
292
332
|
"OpenMode",
|
|
293
333
|
"OptExcInfo",
|
|
294
334
|
"Parallelism",
|
|
295
335
|
"ParseObjectExtra",
|
|
296
336
|
"PathLike",
|
|
297
|
-
"
|
|
337
|
+
"PatternLike",
|
|
338
|
+
"PlainDateTimeLike",
|
|
339
|
+
"Retry",
|
|
298
340
|
"Seed",
|
|
341
|
+
"SequenceStr",
|
|
299
342
|
"SerializeObjectExtra",
|
|
300
343
|
"Sign",
|
|
301
344
|
"StrMapping",
|
|
@@ -305,36 +348,23 @@ __all__ = [
|
|
|
305
348
|
"SupportsBytes",
|
|
306
349
|
"SupportsComplex",
|
|
307
350
|
"SupportsFloat",
|
|
351
|
+
"SupportsFloatOrIndex",
|
|
308
352
|
"SupportsGT",
|
|
309
353
|
"SupportsInt",
|
|
310
354
|
"SupportsInt",
|
|
355
|
+
"SupportsKeysAndGetItem",
|
|
311
356
|
"SupportsLT",
|
|
312
357
|
"SupportsRichComparison",
|
|
313
358
|
"SupportsRound",
|
|
314
|
-
"TBaseException",
|
|
315
|
-
"TCallable",
|
|
316
|
-
"TCallable1",
|
|
317
|
-
"TCallable2",
|
|
318
|
-
"TCallableMaybeCoroutine1None",
|
|
319
|
-
"TDataclass",
|
|
320
|
-
"TEnum",
|
|
321
|
-
"THashable",
|
|
322
|
-
"THashable1",
|
|
323
|
-
"THashable2",
|
|
324
|
-
"TSupportsAbs",
|
|
325
|
-
"TSupportsAdd",
|
|
326
|
-
"TSupportsBytes",
|
|
327
|
-
"TSupportsComplex",
|
|
328
|
-
"TSupportsGT",
|
|
329
|
-
"TSupportsIndex",
|
|
330
|
-
"TSupportsInt",
|
|
331
|
-
"TSupportsLT",
|
|
332
|
-
"TSupportsRichComparison",
|
|
333
359
|
"TimeDeltaLike",
|
|
334
360
|
"TimeLike",
|
|
361
|
+
"TimeOrDateTimeDelta",
|
|
335
362
|
"TimeZone",
|
|
336
363
|
"TimeZoneLike",
|
|
337
364
|
"TupleOrStrMapping",
|
|
338
365
|
"TypeLike",
|
|
366
|
+
"UUIDLike",
|
|
339
367
|
"WeekDay",
|
|
368
|
+
"YearMonthLike",
|
|
369
|
+
"ZonedDateTimeLike",
|
|
340
370
|
]
|