thds.core 1.32.20250306172153__py3-none-any.whl → 1.32.20250307203130__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.

Potentially problematic release.


This version of thds.core might be problematic. Click here for more details.

thds/core/dict_utils.py CHANGED
@@ -54,7 +54,7 @@ def flatten(d: Mapping, parent_key: str = "", sep: str = DEFAULT_SEP) -> Dict[st
54
54
  return dict(_flatten_gen(d, parent_key, sep))
55
55
 
56
56
 
57
- class DotDict(MutableMapping[str, VT]):
57
+ class DotDict(dict, MutableMapping[str, VT]):
58
58
  """A python dictionary that acts like an object."""
59
59
 
60
60
  _new_to_orig_keys: Dict[str, str] = dict()
@@ -87,13 +87,16 @@ class DotDict(MutableMapping[str, VT]):
87
87
  self._construct(mapping=kwargs)
88
88
 
89
89
  def __getattr__(self, key: str) -> VT:
90
- return self[key]
90
+ try:
91
+ return self[key]
92
+ except KeyError:
93
+ raise AttributeError(key)
91
94
 
92
95
  def __setattr__(self, key: str, value: VT) -> None:
93
96
  self.__setitem__(key, value)
94
97
 
95
98
  def __setitem__(self, key: str, value: VT):
96
- self.__dict__.update({key: value})
99
+ super(DotDict, self).__setitem__(key, value)
97
100
 
98
101
  def __delattr__(self, key: str) -> None:
99
102
  self.__delitem__(key)
@@ -102,15 +105,6 @@ class DotDict(MutableMapping[str, VT]):
102
105
  super(DotDict, self).__delitem__(key)
103
106
  del self.__dict__[key]
104
107
 
105
- def __getitem__(self, key: str) -> VT:
106
- return self.__dict__[key]
107
-
108
- def __iter__(self):
109
- return iter(self.__dict__)
110
-
111
- def __len__(self) -> int:
112
- return len(self.__dict__)
113
-
114
108
  def to_dict(self, orig_keys: bool = False) -> Dict[str, VT]:
115
109
  convert_keys_to_identifiers = self._get_hidden_data("convert_keys_to_identifiers")
116
110
  d: Dict[str, VT] = dict()
thds/core/log/logfmt.py CHANGED
@@ -70,14 +70,14 @@ class Logfmter(logging.Formatter):
70
70
  Process the provided string with any necessary quoting and/or escaping.
71
71
  """
72
72
  needs_dquote_escaping = '"' in value
73
- needs_newline_escaping = "\n" in value
73
+ # needs_newline_escaping = "\n" in value
74
74
  needs_quoting = " " in value or "=" in value
75
75
 
76
76
  if needs_dquote_escaping:
77
77
  value = value.replace('"', '\\"')
78
78
 
79
- if needs_newline_escaping:
80
- value = value.replace("\n", "\\n")
79
+ # if needs_newline_escaping:
80
+ # value = value.replace("\n", "\\n")
81
81
 
82
82
  if needs_quoting:
83
83
  value = '"{}"'.format(value)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: thds.core
3
- Version: 1.32.20250306172153
3
+ Version: 1.32.20250307203130
4
4
  Summary: Core utilities.
5
5
  Author-email: Trilliant Health <info@trillianthealth.com>
6
6
  License: MIT
@@ -6,7 +6,7 @@ thds/core/cm.py,sha256=WZB8eQU0DaBYj9s97nc3PuCtai9guovfyiQH68zhLzY,1086
6
6
  thds/core/concurrency.py,sha256=NQunF_tJ_z8cfVyhzkTPlb-nZrgu-vIk9_3XffgscKQ,3520
7
7
  thds/core/config.py,sha256=VWymw6pqPRvX7wwsJ0Y-D2gLoCclAHhARmTnuUw7kb0,10014
8
8
  thds/core/decos.py,sha256=VpFTKTArXepICxN4U8C8J6Z5KDq-yVjFZQzqs2jeVAk,1341
9
- thds/core/dict_utils.py,sha256=MAVkGJg4KQN1UGBLEKuPdQucZaXg_jJakujQ-GUrYzw,6471
9
+ thds/core/dict_utils.py,sha256=MatsjZC9lchfdaDqNAzL2mkTZytDnCAqg56sMm71wbE,6364
10
10
  thds/core/env.py,sha256=M36CYkPZ5AUf_-n8EqjsMGwWOzaKEn0KgRwnqUK7jS4,1094
11
11
  thds/core/exit_after.py,sha256=0lz63nz2NTiIdyBDYyRa9bQShxQKe7eISy8VhXeW4HU,3485
12
12
  thds/core/files.py,sha256=NJlPXj7BejKd_Pa06MOywVv_YapT4bVedfsJHrWX8nI,4579
@@ -44,7 +44,7 @@ thds/core/log/basic_config.py,sha256=2Y9U_c4PTrIsCmaN7Ps6Xr90AhJPzdYjeUzUMqO7oFU
44
44
  thds/core/log/json_formatter.py,sha256=C5bRsSbAqaQqfTm88jc3mYe3vwKZZLAxET8s7_u7aN0,1757
45
45
  thds/core/log/kw_formatter.py,sha256=9-MVOd2r5NEkYNne9qWyFMeR5lac3w7mjHXsDa681i0,3379
46
46
  thds/core/log/kw_logger.py,sha256=CyZVPnkUMtrUL2Lyk261AIEPmoP-buf_suFAhQlU1io,4063
47
- thds/core/log/logfmt.py,sha256=qS6BbdlOZPRnxmHenVL3uK43OQ30NJUnz92S6d_Yh2A,10360
47
+ thds/core/log/logfmt.py,sha256=i66zoG2oERnE1P_0TVXdlfJ1YgUmvtMjqRtdV5u2SvU,10366
48
48
  thds/core/source/__init__.py,sha256=RiaUHNunoaw4XJUrwR5vJzSS6HGxOUKUONR_ipX5654,424
49
49
  thds/core/source/_construct.py,sha256=klN6-fSJrsbbUhp92wzhJcF73h_PKKJItNLC__vwlIs,3122
50
50
  thds/core/source/_download.py,sha256=pUhkphHdB7y4ZpxZZ6ITIS5giXMHuRf420yYAJwx6aE,2924
@@ -66,8 +66,8 @@ thds/core/sqlite/structured.py,sha256=swCbDoyVT6cE7Kl79Wh_rg5Z1-yrUDJbiVJF4bjset
66
66
  thds/core/sqlite/types.py,sha256=oUkfoKRYNGDPZRk29s09rc9ha3SCk2SKr_K6WKebBFs,1308
67
67
  thds/core/sqlite/upsert.py,sha256=BmKK6fsGVedt43iY-Lp7dnAu8aJ1e9CYlPVEQR2pMj4,5827
68
68
  thds/core/sqlite/write.py,sha256=z0219vDkQDCnsV0WLvsj94keItr7H4j7Y_evbcoBrWU,3458
69
- thds.core-1.32.20250306172153.dist-info/METADATA,sha256=Bx2dcIY5FECuzf8hUZX7tCNhe-UUI_ZAnbHYsDfMcd0,2277
70
- thds.core-1.32.20250306172153.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
71
- thds.core-1.32.20250306172153.dist-info/entry_points.txt,sha256=bOCOVhKZv7azF3FvaWX6uxE6yrjK6FcjqhtxXvLiFY8,161
72
- thds.core-1.32.20250306172153.dist-info/top_level.txt,sha256=LTZaE5SkWJwv9bwOlMbIhiS-JWQEEIcjVYnJrt-CriY,5
73
- thds.core-1.32.20250306172153.dist-info/RECORD,,
69
+ thds.core-1.32.20250307203130.dist-info/METADATA,sha256=4iwIb0idRnA0viaOa59vZTu36hiQ-MAKJBXRHg4Q4Is,2277
70
+ thds.core-1.32.20250307203130.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
71
+ thds.core-1.32.20250307203130.dist-info/entry_points.txt,sha256=bOCOVhKZv7azF3FvaWX6uxE6yrjK6FcjqhtxXvLiFY8,161
72
+ thds.core-1.32.20250307203130.dist-info/top_level.txt,sha256=LTZaE5SkWJwv9bwOlMbIhiS-JWQEEIcjVYnJrt-CriY,5
73
+ thds.core-1.32.20250307203130.dist-info/RECORD,,