none-shall-parse 0.4.6__tar.gz → 0.4.8__tar.gz
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.
- {none_shall_parse-0.4.6 → none_shall_parse-0.4.8}/PKG-INFO +1 -1
- {none_shall_parse-0.4.6 → none_shall_parse-0.4.8}/pyproject.toml +1 -1
- {none_shall_parse-0.4.6 → none_shall_parse-0.4.8}/src/none_shall_parse/__init__.py +4 -4
- {none_shall_parse-0.4.6 → none_shall_parse-0.4.8}/src/none_shall_parse/dates.py +13 -0
- {none_shall_parse-0.4.6 → none_shall_parse-0.4.8}/README.md +0 -0
- {none_shall_parse-0.4.6 → none_shall_parse-0.4.8}/src/none_shall_parse/imeis.py +0 -0
- {none_shall_parse-0.4.6 → none_shall_parse-0.4.8}/src/none_shall_parse/lists.py +0 -0
- {none_shall_parse-0.4.6 → none_shall_parse-0.4.8}/src/none_shall_parse/parse.py +0 -0
- {none_shall_parse-0.4.6 → none_shall_parse-0.4.8}/src/none_shall_parse/strings.py +0 -0
- {none_shall_parse-0.4.6 → none_shall_parse-0.4.8}/src/none_shall_parse/types.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: none-shall-parse
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.8
|
|
4
4
|
Summary: Trinity Shared Python utilities.
|
|
5
5
|
Author: Andries Niemandt, Jan Badenhorst
|
|
6
6
|
Author-email: Andries Niemandt <andries.niemandt@trintel.co.za>, Jan Badenhorst <jan@trintel.co.za>
|
|
@@ -14,11 +14,11 @@ from __future__ import annotations
|
|
|
14
14
|
from .dates import (
|
|
15
15
|
DateUtilsError, assert_week_start_date_is_valid,
|
|
16
16
|
assert_month_start_date_is_valid,
|
|
17
|
-
get_datetime_now, za_now,
|
|
17
|
+
get_datetime_now, za_now, utc_now,
|
|
18
18
|
za_ordinal_year_day_now,
|
|
19
19
|
za_ordinal_year_day_tomorrow, utc_epoch_start,
|
|
20
20
|
now_offset_n_minutes, now_offset_n_hours,
|
|
21
|
-
now_offset_n_days, get_datetime_tomorrow,
|
|
21
|
+
now_offset_n_days, now_offset_n_months, get_datetime_tomorrow,
|
|
22
22
|
get_datetime_yesterday,
|
|
23
23
|
get_utc_datetime_offset_n_days,
|
|
24
24
|
epoch_to_datetime, epoch_to_utc_datetime,
|
|
@@ -85,11 +85,11 @@ __license__ = "MIT"
|
|
|
85
85
|
__all__ = (
|
|
86
86
|
"DateUtilsError", "assert_week_start_date_is_valid",
|
|
87
87
|
"assert_month_start_date_is_valid",
|
|
88
|
-
"get_datetime_now", "za_now",
|
|
88
|
+
"get_datetime_now", "za_now", "utc_now",
|
|
89
89
|
"za_ordinal_year_day_now",
|
|
90
90
|
"za_ordinal_year_day_tomorrow", "utc_epoch_start",
|
|
91
91
|
"now_offset_n_minutes", "now_offset_n_hours",
|
|
92
|
-
"now_offset_n_days", "get_datetime_tomorrow",
|
|
92
|
+
"now_offset_n_days", "now_offset_n_months", "get_datetime_tomorrow",
|
|
93
93
|
"get_datetime_yesterday",
|
|
94
94
|
"get_utc_datetime_offset_n_days",
|
|
95
95
|
"epoch_to_datetime", "epoch_to_utc_datetime",
|
|
@@ -71,6 +71,15 @@ def za_now() -> DateTime:
|
|
|
71
71
|
return get_datetime_now(naive=False, tz=ZA_TZ)
|
|
72
72
|
|
|
73
73
|
|
|
74
|
+
def utc_now() -> DateTime:
|
|
75
|
+
"""
|
|
76
|
+
Shorthand for the current date and time in the UTC timezone.
|
|
77
|
+
Returns:
|
|
78
|
+
pendulum.DateTime: The current date and time in the UTC timezone.
|
|
79
|
+
"""
|
|
80
|
+
return get_datetime_now(naive=False, tz=UTC_TZ)
|
|
81
|
+
|
|
82
|
+
|
|
74
83
|
def za_ordinal_year_day_now() -> int:
|
|
75
84
|
"""
|
|
76
85
|
Returns the current ordinal day of the year for the ZA_TZ timezone.
|
|
@@ -151,6 +160,10 @@ def now_offset_n_days(n: int, naive: bool = False,
|
|
|
151
160
|
return _now_offset_n_units(n, units="days", naive=naive, tz=tz)
|
|
152
161
|
|
|
153
162
|
|
|
163
|
+
def now_offset_n_months(n: int, naive: bool = False, tz: str | None = None) -> DateTime:
|
|
164
|
+
return _now_offset_n_units(n, units="months", naive=naive, tz=tz)
|
|
165
|
+
|
|
166
|
+
|
|
154
167
|
def get_datetime_tomorrow(naive: bool = False,
|
|
155
168
|
tz: str | None = None) -> DateTime:
|
|
156
169
|
"""Get tomorrow's DateTime"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|