mm-std 0.7.0__py3-none-any.whl → 0.7.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.
mm_std/__init__.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""mm-std: Python utilities for common data manipulation tasks."""
|
|
2
2
|
|
|
3
3
|
from .date_utils import parse_datetime as parse_datetime
|
|
4
|
+
from .date_utils import utc as utc
|
|
4
5
|
from .date_utils import utc_from_timestamp as utc_from_timestamp
|
|
5
6
|
from .date_utils import utc_now as utc_now
|
|
6
7
|
from .date_utils import utc_now_offset as utc_now_offset
|
mm_std/date_utils.py
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
"""UTC-focused datetime operations and flexible date parsing."""
|
|
2
2
|
|
|
3
3
|
from datetime import UTC, datetime, timedelta
|
|
4
|
+
from warnings import deprecated
|
|
4
5
|
|
|
5
6
|
|
|
7
|
+
def utc(*, days: int = 0, hours: int = 0, minutes: int = 0, seconds: int = 0) -> datetime:
|
|
8
|
+
"""Get current UTC time, optionally shifted by the specified delta.
|
|
9
|
+
|
|
10
|
+
Use negative values to get time in the past.
|
|
11
|
+
"""
|
|
12
|
+
return datetime.now(UTC) + timedelta(days=days, hours=hours, minutes=minutes, seconds=seconds)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@deprecated("Use utc() instead")
|
|
6
16
|
def utc_now() -> datetime:
|
|
7
17
|
"""Get current UTC time."""
|
|
8
18
|
return datetime.now(UTC)
|
|
9
19
|
|
|
10
20
|
|
|
21
|
+
@deprecated("Use utc() instead")
|
|
11
22
|
def utc_now_offset(
|
|
12
23
|
*, days: int | None = None, hours: int | None = None, minutes: int | None = None, seconds: int | None = None
|
|
13
24
|
) -> datetime:
|
mm_std/dict_utils.py
CHANGED
|
@@ -68,7 +68,7 @@ def compact_dict(
|
|
|
68
68
|
defaults = {}
|
|
69
69
|
|
|
70
70
|
if isinstance(mapping, defaultdict):
|
|
71
|
-
result: MutableMapping[K, V] = defaultdict(mapping.default_factory)
|
|
71
|
+
result: MutableMapping[K, V] = defaultdict(mapping.default_factory) # ty: ignore[invalid-assignment]
|
|
72
72
|
else:
|
|
73
73
|
result = mapping.__class__()
|
|
74
74
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
mm_std/__init__.py,sha256=ht2S82wgsfz7A3IDqnWjlYS0hVZnNFGbyiZLBkvLWio,1196
|
|
2
|
+
mm_std/date_utils.py,sha256=yTXOB0BGe1K3mmVX4qCG-SrNWtbN9LHs-hHL3wNZggQ,2537
|
|
3
|
+
mm_std/dict_utils.py,sha256=JaC078oFqzcvncqnio9CQy71iPEvPS2I0AHkw7eb484,2916
|
|
4
|
+
mm_std/json_utils.py,sha256=lOlleRdI9mdrB-s0nAfxiaQ5LTcbfEea2uObh0W-dzs,4196
|
|
5
|
+
mm_std/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
mm_std/random_utils.py,sha256=oGZhOg6rIft3SRpWv2lB6IAyvdWEN08-7BVrC5_vfoc,2889
|
|
7
|
+
mm_std/str_utils.py,sha256=p6hxxoe3xiuPSqb1vc3TbNfUoSwdW6z_OJG_3Qx7ITA,1563
|
|
8
|
+
mm_std/subprocess_utils.py,sha256=Sr8ENMg29CkhgpJi5PaW7h7tEviaEFurVJKcfR16itE,4057
|
|
9
|
+
mm_std-0.7.1.dist-info/METADATA,sha256=JEMjn_OOdJff2WYQjfe3XvjoCWQW5dXjD9tgAy85Tn4,74
|
|
10
|
+
mm_std-0.7.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
11
|
+
mm_std-0.7.1.dist-info/RECORD,,
|
mm_std-0.7.0.dist-info/RECORD
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
mm_std/__init__.py,sha256=7hmdftEHF19ef6jtwVDH3J7vEZLV3j5ZgIksZTLd_l0,1161
|
|
2
|
-
mm_std/date_utils.py,sha256=cGdTEXwsIQS6ZPTvjQRlkTTIf0yL2GCj_uYa8i0pzps,2117
|
|
3
|
-
mm_std/dict_utils.py,sha256=bddxRbemL7UZ9rp7k2bkBDsYX-NbVXv8CPL7ESjPxXc,2882
|
|
4
|
-
mm_std/json_utils.py,sha256=lOlleRdI9mdrB-s0nAfxiaQ5LTcbfEea2uObh0W-dzs,4196
|
|
5
|
-
mm_std/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
mm_std/random_utils.py,sha256=oGZhOg6rIft3SRpWv2lB6IAyvdWEN08-7BVrC5_vfoc,2889
|
|
7
|
-
mm_std/str_utils.py,sha256=p6hxxoe3xiuPSqb1vc3TbNfUoSwdW6z_OJG_3Qx7ITA,1563
|
|
8
|
-
mm_std/subprocess_utils.py,sha256=Sr8ENMg29CkhgpJi5PaW7h7tEviaEFurVJKcfR16itE,4057
|
|
9
|
-
mm_std-0.7.0.dist-info/METADATA,sha256=scnEov8zndpkmqWOgIde_iVjbb-arHejeuiKDt7Csbg,74
|
|
10
|
-
mm_std-0.7.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
11
|
-
mm_std-0.7.0.dist-info/RECORD,,
|
|
File without changes
|