utg-base 1.22.0__py3-none-any.whl → 1.22.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.
utg_base/utils/data.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import datetime
|
|
2
1
|
from collections import defaultdict
|
|
3
2
|
from collections.abc import Iterable
|
|
4
3
|
from copy import deepcopy
|
|
5
4
|
|
|
5
|
+
from dateutil.relativedelta import relativedelta
|
|
6
6
|
from django.db.models import QuerySet
|
|
7
7
|
|
|
8
8
|
from utg_base.utils.date import UDate, UDateTime
|
|
@@ -162,12 +162,12 @@ def compute_change_percent(current, previous, ndigits=2):
|
|
|
162
162
|
def list_to_dict(rows: Iterable[dict], key: str, key_func=None) -> dict:
|
|
163
163
|
if not key_func:
|
|
164
164
|
key_func = lambda x: x
|
|
165
|
-
return {row[
|
|
165
|
+
return {key_func(row[key]): row for row in rows}
|
|
166
166
|
|
|
167
167
|
|
|
168
|
-
def generate_series(start: UDate | UDateTime, end: UDate | UDateTime, step:
|
|
168
|
+
def generate_series(start: UDate | UDateTime, end: UDate | UDateTime, step: relativedelta):
|
|
169
169
|
current = start
|
|
170
|
-
if step
|
|
170
|
+
if step == relativedelta():
|
|
171
171
|
raise ValueError("step cannot be zero")
|
|
172
172
|
|
|
173
173
|
series = []
|
|
@@ -60,7 +60,7 @@ utg_base/u_services/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
|
|
|
60
60
|
utg_base/u_services/models.py,sha256=seaxBj9vNWrPu1Y8r7NzHEuXemtSvqLkaw4S1Xgr58I,1310
|
|
61
61
|
utg_base/u_services/u_requests.py,sha256=fGNWWQ3RJOOARgNHkScsqlGXwP6sI-HnS3Y-HnSoVS4,1709
|
|
62
62
|
utg_base/utils/__init__.py,sha256=zRTdSLGpukInlb7oRD6vcI1jKQkkBR3jTCiOiwOmRyA,159
|
|
63
|
-
utg_base/utils/data.py,sha256=
|
|
63
|
+
utg_base/utils/data.py,sha256=gkPPA3TCQKZUyFYr_FYiOs6WWOXz2R5eMpaLNUg-zCo,5065
|
|
64
64
|
utg_base/utils/date.py,sha256=fS4o5Nd4HyNyHBJTSsasTlqSMNjnNHwocSYdinkKyeY,4371
|
|
65
65
|
utg_base/utils/dict_util.py,sha256=ipdCZO8aTukGQ319OWHb2Ij5MNtV-FioJQ4qCX3Th48,758
|
|
66
66
|
utg_base/utils/response_processors.py,sha256=WdZQL49wOJqCIY2MucAI6sez_llCqih0v_ltQa-mv7k,687
|
|
@@ -69,6 +69,6 @@ utg_base/utils/sql.py,sha256=rqIWcSjdjIMszdRnsnhV5TTYB8W17RPOujIQA9rKC_Y,762
|
|
|
69
69
|
utg_base/utils/string.py,sha256=ATwIo9uLa00p85h_NjRYLcjRs8o3KSGF7s2yhTg5GiA,1073
|
|
70
70
|
utg_base/utils/thread.py,sha256=4RqRnwtyHymY-dNcuPrMSTamE2V7wCMVfzzyIb0P4TI,2191
|
|
71
71
|
utg_base/utils/translation.py,sha256=GxJHUt0iar_0E7RWBPbeLFQ4DhgXBjffHCmxfKyjFtk,463
|
|
72
|
-
utg_base-1.22.
|
|
73
|
-
utg_base-1.22.
|
|
74
|
-
utg_base-1.22.
|
|
72
|
+
utg_base-1.22.1.dist-info/METADATA,sha256=iaemYNLkRQoJSFm8esfYMOp8OjKqdCwQxNcehAh7cM0,960
|
|
73
|
+
utg_base-1.22.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
74
|
+
utg_base-1.22.1.dist-info/RECORD,,
|
|
File without changes
|