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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: none-shall-parse
3
- Version: 0.4.6
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>
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "none-shall-parse"
7
- version = "0.4.6"
7
+ version = "0.4.8"
8
8
  description = "Trinity Shared Python utilities."
9
9
  readme = "README.md"
10
10
  authors = [
@@ -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"""