dycw-utilities 0.138.12__py3-none-any.whl → 0.138.13__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.12.dist-info → dycw_utilities-0.138.13.dist-info}/METADATA +1 -1
- {dycw_utilities-0.138.12.dist-info → dycw_utilities-0.138.13.dist-info}/RECORD +7 -7
- utilities/__init__.py +1 -1
- utilities/whenever.py +22 -0
- {dycw_utilities-0.138.12.dist-info → dycw_utilities-0.138.13.dist-info}/WHEEL +0 -0
- {dycw_utilities-0.138.12.dist-info → dycw_utilities-0.138.13.dist-info}/entry_points.txt +0 -0
- {dycw_utilities-0.138.12.dist-info → dycw_utilities-0.138.13.dist-info}/licenses/LICENSE +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
utilities/__init__.py,sha256=
|
1
|
+
utilities/__init__.py,sha256=H_o_NgK-Ik1btEjTSpGwNncTNEm929ZR7pKgfRuqfHU,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=z2x79yEElAEaQ3roWC8LFl-rwFuv4WgcFiGQoAbSVJA,22004
|
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.13.dist-info/METADATA,sha256=XM3QnEEq6J7ZY99VLuNV6kqaRrfGabIAkgoD9eh1mUw,1639
|
92
|
+
dycw_utilities-0.138.13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
93
|
+
dycw_utilities-0.138.13.dist-info/entry_points.txt,sha256=uLj5QWWVXv8tnMaRX3ZGYpt7w1xzLWU6LxbFhELEpkc,68
|
94
|
+
dycw_utilities-0.138.13.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
|
95
|
+
dycw_utilities-0.138.13.dist-info/RECORD,,
|
utilities/__init__.py
CHANGED
utilities/whenever.py
CHANGED
@@ -552,6 +552,26 @@ def to_local_plain(date_time: ZonedDateTime, /) -> PlainDateTime:
|
|
552
552
|
##
|
553
553
|
|
554
554
|
|
555
|
+
def to_months(delta: DateDelta, /) -> int:
|
556
|
+
"""Compute the number of months in a date delta."""
|
557
|
+
months, days = delta.in_months_days()
|
558
|
+
if days != 0:
|
559
|
+
raise ToMonthsError(days=days)
|
560
|
+
return months
|
561
|
+
|
562
|
+
|
563
|
+
@dataclass(kw_only=True, slots=True)
|
564
|
+
class ToMonthsError(Exception):
|
565
|
+
days: int
|
566
|
+
|
567
|
+
@override
|
568
|
+
def __str__(self) -> str:
|
569
|
+
return f"Date delta must not contain days; got {self.days}"
|
570
|
+
|
571
|
+
|
572
|
+
##
|
573
|
+
|
574
|
+
|
555
575
|
def to_nanos(delta: DateTimeDelta, /) -> int:
|
556
576
|
"""Compute the number of nanoseconds in a date-time delta."""
|
557
577
|
try:
|
@@ -801,6 +821,7 @@ __all__ = [
|
|
801
821
|
"MeanDateTimeError",
|
802
822
|
"MinMaxDateError",
|
803
823
|
"ToDaysError",
|
824
|
+
"ToMonthsError",
|
804
825
|
"ToNanosError",
|
805
826
|
"ToPyTimeDeltaError",
|
806
827
|
"WheneverLogRecord",
|
@@ -819,6 +840,7 @@ __all__ = [
|
|
819
840
|
"to_date_time_delta",
|
820
841
|
"to_days",
|
821
842
|
"to_local_plain",
|
843
|
+
"to_months",
|
822
844
|
"to_nanos",
|
823
845
|
"to_py_time_delta",
|
824
846
|
"to_zoned_date_time",
|
File without changes
|
File without changes
|
File without changes
|