dycw-utilities 0.138.13__py3-none-any.whl → 0.138.14__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.138.13.dist-info → dycw_utilities-0.138.14.dist-info}/METADATA +1 -1
- {dycw_utilities-0.138.13.dist-info → dycw_utilities-0.138.14.dist-info}/RECORD +7 -7
- utilities/__init__.py +1 -1
- utilities/whenever.py +29 -0
- {dycw_utilities-0.138.13.dist-info → dycw_utilities-0.138.14.dist-info}/WHEEL +0 -0
- {dycw_utilities-0.138.13.dist-info → dycw_utilities-0.138.14.dist-info}/entry_points.txt +0 -0
- {dycw_utilities-0.138.13.dist-info → dycw_utilities-0.138.14.dist-info}/licenses/LICENSE +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
utilities/__init__.py,sha256=
|
1
|
+
utilities/__init__.py,sha256=cONkI_IFNfSqcsGihpBZx7cXfo2yNGxHqPOWbR64rSs,61
|
2
2
|
utilities/aiolimiter.py,sha256=mD0wEiqMgwpty4XTbawFpnkkmJS6R4JRsVXFUaoitSU,628
|
3
3
|
utilities/altair.py,sha256=HeZBVUocjkrTNwwKrClppsIqgNFF-ykv05HfZSoHYno,9104
|
4
4
|
utilities/asyncio.py,sha256=dcGeKQzjLBXxKzZkVIk5oZsFXEcynVbRB9iNB5XEDZk,38526
|
@@ -85,11 +85,11 @@ utilities/tzlocal.py,sha256=KyCXEgCTjqGFx-389JdTuhMRUaT06U1RCMdWoED-qro,728
|
|
85
85
|
utilities/uuid.py,sha256=32p7DGHGM2Btx6PcBvCZvERSWbpupMXqx6FppPoSoTU,612
|
86
86
|
utilities/version.py,sha256=ufhJMmI6KPs1-3wBI71aj5wCukd3sP_m11usLe88DNA,5117
|
87
87
|
utilities/warnings.py,sha256=un1LvHv70PU-LLv8RxPVmugTzDJkkGXRMZTE2-fTQHw,1771
|
88
|
-
utilities/whenever.py,sha256=
|
88
|
+
utilities/whenever.py,sha256=WicmnXSFuZ64kemfULZGcV8Pt8-h6VBHJcObMHugSEo,22760
|
89
89
|
utilities/zipfile.py,sha256=24lQc9ATcJxHXBPc_tBDiJk48pWyRrlxO2fIsFxU0A8,699
|
90
90
|
utilities/zoneinfo.py,sha256=oEH-nL3t4h9uawyZqWDtNtDAl6M-CLpLYGI_nI6DulM,1971
|
91
|
-
dycw_utilities-0.138.
|
92
|
-
dycw_utilities-0.138.
|
93
|
-
dycw_utilities-0.138.
|
94
|
-
dycw_utilities-0.138.
|
95
|
-
dycw_utilities-0.138.
|
91
|
+
dycw_utilities-0.138.14.dist-info/METADATA,sha256=mFTnGB2iv53YtekLXrv-Zc1Zh1HVuwHpU9ZHrd30YXE,1639
|
92
|
+
dycw_utilities-0.138.14.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
93
|
+
dycw_utilities-0.138.14.dist-info/entry_points.txt,sha256=uLj5QWWVXv8tnMaRX3ZGYpt7w1xzLWU6LxbFhELEpkc,68
|
94
|
+
dycw_utilities-0.138.14.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
|
95
|
+
dycw_utilities-0.138.14.dist-info/RECORD,,
|
utilities/__init__.py
CHANGED
utilities/whenever.py
CHANGED
@@ -155,6 +155,34 @@ def datetime_utc(
|
|
155
155
|
##
|
156
156
|
|
157
157
|
|
158
|
+
@overload
|
159
|
+
def diff_year_month(
|
160
|
+
x: YearMonth, y: YearMonth, /, *, years: Literal[True]
|
161
|
+
) -> tuple[int, int]: ...
|
162
|
+
@overload
|
163
|
+
def diff_year_month(
|
164
|
+
x: YearMonth, y: YearMonth, /, *, years: Literal[False] = False
|
165
|
+
) -> int: ...
|
166
|
+
@overload
|
167
|
+
def diff_year_month(
|
168
|
+
x: YearMonth, y: YearMonth, /, *, years: bool = False
|
169
|
+
) -> int | tuple[int, int]: ...
|
170
|
+
def diff_year_month(
|
171
|
+
x: YearMonth, y: YearMonth, /, *, years: bool = False
|
172
|
+
) -> int | tuple[int, int]:
|
173
|
+
"""Compute the difference between two year-months."""
|
174
|
+
x_date, y_date = x.on_day(1), y.on_day(1)
|
175
|
+
diff = x_date - y_date
|
176
|
+
if years:
|
177
|
+
yrs, mth, _ = diff.in_years_months_days()
|
178
|
+
return yrs, mth
|
179
|
+
mth, _ = diff.in_months_days()
|
180
|
+
return mth
|
181
|
+
|
182
|
+
|
183
|
+
##
|
184
|
+
|
185
|
+
|
158
186
|
def format_compact(
|
159
187
|
obj: Date | Time | PlainDateTime | ZonedDateTime, /, *, fmt: str | None = None
|
160
188
|
) -> str:
|
@@ -826,6 +854,7 @@ __all__ = [
|
|
826
854
|
"ToPyTimeDeltaError",
|
827
855
|
"WheneverLogRecord",
|
828
856
|
"datetime_utc",
|
857
|
+
"diff_year_month",
|
829
858
|
"format_compact",
|
830
859
|
"from_timestamp",
|
831
860
|
"from_timestamp_millis",
|
File without changes
|
File without changes
|
File without changes
|