dycw-utilities 0.150.6__py3-none-any.whl → 0.150.8__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.150.6.dist-info → dycw_utilities-0.150.8.dist-info}/METADATA +1 -1
- {dycw_utilities-0.150.6.dist-info → dycw_utilities-0.150.8.dist-info}/RECORD +8 -8
- utilities/__init__.py +1 -1
- utilities/postgres.py +12 -0
- utilities/text.py +20 -1
- {dycw_utilities-0.150.6.dist-info → dycw_utilities-0.150.8.dist-info}/WHEEL +0 -0
- {dycw_utilities-0.150.6.dist-info → dycw_utilities-0.150.8.dist-info}/entry_points.txt +0 -0
- {dycw_utilities-0.150.6.dist-info → dycw_utilities-0.150.8.dist-info}/licenses/LICENSE +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
utilities/__init__.py,sha256=
|
1
|
+
utilities/__init__.py,sha256=YVjGN81XwOvDb88xy84S4gzjgPT1NkOE5z4MHUAmlJk,60
|
2
2
|
utilities/altair.py,sha256=92E2lCdyHY4Zb-vCw6rEJIsWdKipuu-Tu2ab1ufUfAk,9079
|
3
3
|
utilities/asyncio.py,sha256=2m2a2C-Qgc6OHTTHL332-t66A7xDITt_SORT7a1DJWo,16792
|
4
4
|
utilities/atomicwrites.py,sha256=xcOWenTBRS0oat3kg7Sqe51AohNThMQ2ixPL7QCG8hw,5795
|
@@ -49,7 +49,7 @@ utilities/pickle.py,sha256=MBT2xZCsv0pH868IXLGKnlcqNx2IRVKYNpRcqiQQqxw,653
|
|
49
49
|
utilities/platform.py,sha256=Ue9LSxYvg9yUXGKuz5aZoy_qkUEXde-v6B09exgSctU,2813
|
50
50
|
utilities/polars.py,sha256=BgiDryAVOapi41ddfJqN0wYh_sDj8BNEYtPB36LaHdo,71824
|
51
51
|
utilities/polars_ols.py,sha256=Uc9V5kvlWZ5cU93lKZ-cfAKdVFFw81tqwLW9PxtUvMs,5618
|
52
|
-
utilities/postgres.py,sha256=
|
52
|
+
utilities/postgres.py,sha256=L1cunDLu8nK5fCkY9fTgSTHjT1_B8Y0iUJEjPC7Ar3A,13849
|
53
53
|
utilities/pottery.py,sha256=u0uvyGgYyujxftEMlsv6ppYTKQoVVjHt5jnVxxYz9s4,6596
|
54
54
|
utilities/pqdm.py,sha256=BTsYPtbKQWwX-iXF4qCkfPG7DPxIB54J989n83bXrIo,3092
|
55
55
|
utilities/psutil.py,sha256=KUlu4lrUw9Zg1V7ZGetpWpGb9DB8l_SSDWGbANFNCPU,2104
|
@@ -71,7 +71,7 @@ utilities/sqlalchemy_polars.py,sha256=18AoEbeNJUKF3-5hroNy9J5LQwS_QJAXbMfKc9sCht
|
|
71
71
|
utilities/statsmodels.py,sha256=koyiBHvpMcSiBfh99wFUfSggLNx7cuAw3rwyfAhoKpQ,3410
|
72
72
|
utilities/string.py,sha256=MB0X6UPTUc06JdAdj-PctZ238IXeCjE5dAJibNw6ZrU,587
|
73
73
|
utilities/tempfile.py,sha256=HxB2BF28CcecDJLQ3Bx2Ej-Pb6RJc6W9ngSpB9CnP4k,2018
|
74
|
-
utilities/text.py,sha256=
|
74
|
+
utilities/text.py,sha256=bupgC6ILTjmcJKSUGloStzmWuj2Ke0knvVKE2mWLwAM,11619
|
75
75
|
utilities/threading.py,sha256=GvBOp4CyhHfN90wGXZuA2VKe9fGzMaEa7oCl4f3nnPU,1009
|
76
76
|
utilities/timer.py,sha256=oXfTii6ymu57niP0BDGZjFD55LEHi2a19kqZKiTgaFQ,2588
|
77
77
|
utilities/traceback.py,sha256=zofhzIedpUHrzDNiRJDVzm_wuu_tlTQvVqK4quxVlgM,9151
|
@@ -89,8 +89,8 @@ utilities/zoneinfo.py,sha256=oEH-nL3t4h9uawyZqWDtNtDAl6M-CLpLYGI_nI6DulM,1971
|
|
89
89
|
utilities/pytest_plugins/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
90
90
|
utilities/pytest_plugins/pytest_randomly.py,sha256=NXzCcGKbpgYouz5yehKb4jmxmi2SexKKpgF4M65bi10,414
|
91
91
|
utilities/pytest_plugins/pytest_regressions.py,sha256=Iwhfv_OJH7UCPZCfoh7ugZ2Xjqjil-BBBsOb8sDwiGI,1471
|
92
|
-
dycw_utilities-0.150.
|
93
|
-
dycw_utilities-0.150.
|
94
|
-
dycw_utilities-0.150.
|
95
|
-
dycw_utilities-0.150.
|
96
|
-
dycw_utilities-0.150.
|
92
|
+
dycw_utilities-0.150.8.dist-info/METADATA,sha256=OiyG-fA0Ts1JGZX-Nwyk2LDSBdYUanaWWVN-9th7WH0,1696
|
93
|
+
dycw_utilities-0.150.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
94
|
+
dycw_utilities-0.150.8.dist-info/entry_points.txt,sha256=BOD_SoDxwsfJYOLxhrSXhHP_T7iw-HXI9f2WVkzYxvQ,135
|
95
|
+
dycw_utilities-0.150.8.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
|
96
|
+
dycw_utilities-0.150.8.dist-info/RECORD,,
|
utilities/__init__.py
CHANGED
utilities/postgres.py
CHANGED
@@ -37,6 +37,8 @@ async def pg_dump(
|
|
37
37
|
data_only: bool = False,
|
38
38
|
clean: bool = False,
|
39
39
|
create: bool = False,
|
40
|
+
extension: MaybeListStr | None = None,
|
41
|
+
extension_exc: MaybeListStr | None = None,
|
40
42
|
schema: MaybeListStr | None = None,
|
41
43
|
schema_exc: MaybeListStr | None = None,
|
42
44
|
table: MaybeSequence[TableOrORMInstOrClass | str] | None = None,
|
@@ -59,6 +61,8 @@ async def pg_dump(
|
|
59
61
|
data_only=data_only,
|
60
62
|
clean=clean,
|
61
63
|
create=create,
|
64
|
+
extension=extension,
|
65
|
+
extension_exc=extension_exc,
|
62
66
|
schema=schema,
|
63
67
|
schema_exc=schema_exc,
|
64
68
|
table=table,
|
@@ -109,6 +113,8 @@ def _build_pg_dump(
|
|
109
113
|
data_only: bool = False,
|
110
114
|
clean: bool = False,
|
111
115
|
create: bool = False,
|
116
|
+
extension: MaybeListStr | None = None,
|
117
|
+
extension_exc: MaybeListStr | None = None,
|
112
118
|
schema: MaybeListStr | None = None,
|
113
119
|
schema_exc: MaybeListStr | None = None,
|
114
120
|
table: MaybeSequence[TableOrORMInstOrClass | str] | None = None,
|
@@ -141,6 +147,12 @@ def _build_pg_dump(
|
|
141
147
|
parts.append(f"--jobs={jobs}")
|
142
148
|
if create:
|
143
149
|
parts.append("--create")
|
150
|
+
if extension is not None:
|
151
|
+
parts.extend([f"--extension={e}" for e in always_iterable(extension)])
|
152
|
+
if extension_exc is not None:
|
153
|
+
parts.extend([
|
154
|
+
f"--exclude-extension={e}" for e in always_iterable(extension_exc)
|
155
|
+
])
|
144
156
|
if schema is not None:
|
145
157
|
parts.extend([f"--schema={s}" for s in always_iterable(schema)])
|
146
158
|
if schema_exc is not None:
|
utilities/text.py
CHANGED
@@ -9,7 +9,7 @@ from re import IGNORECASE, Match, escape, search
|
|
9
9
|
from textwrap import dedent
|
10
10
|
from threading import get_ident
|
11
11
|
from time import time_ns
|
12
|
-
from typing import TYPE_CHECKING, Any, Literal, overload, override
|
12
|
+
from typing import TYPE_CHECKING, Any, ClassVar, Literal, overload, override
|
13
13
|
from uuid import uuid4
|
14
14
|
|
15
15
|
from utilities.iterables import CheckDuplicatesError, check_duplicates, transpose
|
@@ -385,6 +385,24 @@ def _escape_separator(*, separator: str = DEFAULT_SEPARATOR) -> str:
|
|
385
385
|
##
|
386
386
|
|
387
387
|
|
388
|
+
class secret_str(str): # noqa: N801
|
389
|
+
"""A string with an obfuscated representation."""
|
390
|
+
|
391
|
+
__slots__ = ()
|
392
|
+
_REPR: ClassVar[str] = "***"
|
393
|
+
|
394
|
+
@override
|
395
|
+
def __repr__(self) -> str:
|
396
|
+
return self._REPR
|
397
|
+
|
398
|
+
@override
|
399
|
+
def __str__(self) -> str:
|
400
|
+
return self._REPR
|
401
|
+
|
402
|
+
|
403
|
+
##
|
404
|
+
|
405
|
+
|
388
406
|
def str_encode(obj: Any, /) -> bytes:
|
389
407
|
"""Return the string representation of the object encoded as bytes."""
|
390
408
|
return str(obj).encode()
|
@@ -424,6 +442,7 @@ __all__ = [
|
|
424
442
|
"parse_bool",
|
425
443
|
"parse_none",
|
426
444
|
"repr_encode",
|
445
|
+
"secret_str",
|
427
446
|
"snake_case",
|
428
447
|
"split_key_value_pairs",
|
429
448
|
"split_str",
|
File without changes
|
File without changes
|
File without changes
|