PySerials 0.0.0.dev36__py3-none-any.whl → 0.0.0.dev38__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.
- {PySerials-0.0.0.dev36.dist-info → PySerials-0.0.0.dev38.dist-info}/METADATA +3 -3
- {PySerials-0.0.0.dev36.dist-info → PySerials-0.0.0.dev38.dist-info}/RECORD +7 -6
- {PySerials-0.0.0.dev36.dist-info → PySerials-0.0.0.dev38.dist-info}/WHEEL +1 -1
- pyserials/__init__.py +1 -0
- pyserials/nested_dict.py +11 -0
- pyserials/property_dict.py +49 -0
- {PySerials-0.0.0.dev36.dist-info → PySerials-0.0.0.dev38.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PySerials
|
|
3
|
-
Version: 0.0.0.
|
|
3
|
+
Version: 0.0.0.dev38
|
|
4
4
|
Requires-Python: >=3.10
|
|
5
5
|
Requires-Dist: jsonschema <5,>=4.21.0
|
|
6
6
|
Requires-Dist: referencing >=0.35.1
|
|
@@ -8,7 +8,7 @@ Requires-Dist: jsonpath-ng <2,>=1.6.1
|
|
|
8
8
|
Requires-Dist: ruamel.yaml <0.18,>=0.17.32
|
|
9
9
|
Requires-Dist: ruamel.yaml.string <1,>=0.1.1
|
|
10
10
|
Requires-Dist: tomlkit <0.12,>=0.11.8
|
|
11
|
-
Requires-Dist: MDit ==0.0.0.
|
|
12
|
-
Requires-Dist: ExceptionMan ==0.0.0.
|
|
11
|
+
Requires-Dist: MDit ==0.0.0.dev35
|
|
12
|
+
Requires-Dist: ExceptionMan ==0.0.0.dev35
|
|
13
13
|
Requires-Dist: ProtocolMan ==0.0.0.dev2
|
|
14
14
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
pyserials/__init__.py,sha256
|
|
1
|
+
pyserials/__init__.py,sha256=Ze6ur7qP-581-UYBZ6CjoC34YmLBv4d3jg-16qxCa9U,191
|
|
2
2
|
pyserials/compare.py,sha256=j62A1UIiAm08_xONlbZmU2EcH1GMEpDyEQH66dZ2YMM,1297
|
|
3
3
|
pyserials/format.py,sha256=dTukpab6WHSyVRQ9SteY5fhr3GFjWFboEl-1cw_udVY,1729
|
|
4
|
-
pyserials/nested_dict.py,sha256=
|
|
4
|
+
pyserials/nested_dict.py,sha256=4LsdRWsRknmZv65UDbsyiNGYtG8rxh-F0EdXQNvpUOY,5257
|
|
5
|
+
pyserials/property_dict.py,sha256=Wz04rqbgjVsnsSZcjwdlnCqCdDo3bWjF-im2golpxjw,1148
|
|
5
6
|
pyserials/read.py,sha256=uucYQH1V4GStwRgRZ2eQIXkH4ukB5qz0EA885grwi68,6592
|
|
6
7
|
pyserials/update.py,sha256=tgkd7mywiYvm2tE_jPjuRWYsAoQ2Ap4NQ-OCI0ui9n0,21625
|
|
7
8
|
pyserials/validate.py,sha256=ti0D_yLzB_HELvf1d5qrarx1Ac-opBMN1Xh5lADRAQU,3664
|
|
@@ -11,7 +12,7 @@ pyserials/exception/_base.py,sha256=IdaZwBPBYgiUaWnvN0eMXvQQBqLbN1t766034CK7Hlc,
|
|
|
11
12
|
pyserials/exception/read.py,sha256=QyG6ulExXH9u8oDRjUfter70SMDVQqL4nig5s-JzWN4,9252
|
|
12
13
|
pyserials/exception/update.py,sha256=P0js2-iY2fgO_KLdqedgWE3TTS5Xz15cusZY_wuKIW4,4222
|
|
13
14
|
pyserials/exception/validate.py,sha256=7UkQEEqCa8HJ20gpTFnLDhT3P5OPLD2oD9fUK2Jcuns,7466
|
|
14
|
-
PySerials-0.0.0.
|
|
15
|
-
PySerials-0.0.0.
|
|
16
|
-
PySerials-0.0.0.
|
|
17
|
-
PySerials-0.0.0.
|
|
15
|
+
PySerials-0.0.0.dev38.dist-info/METADATA,sha256=WK_Uzli3D0mdyvmHvBRUugBACWZMCQOqdm8IEwNcQn4,438
|
|
16
|
+
PySerials-0.0.0.dev38.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
|
|
17
|
+
PySerials-0.0.0.dev38.dist-info/top_level.txt,sha256=SAks7WjSjdkv3i9Hvt4gY_P7VQbhhYJN5mf5dqx1aao,10
|
|
18
|
+
PySerials-0.0.0.dev38.dist-info/RECORD,,
|
pyserials/__init__.py
CHANGED
pyserials/nested_dict.py
CHANGED
|
@@ -157,3 +157,14 @@ class NestedDict:
|
|
|
157
157
|
def update(self, data: dict):
|
|
158
158
|
self._data.update(data)
|
|
159
159
|
return
|
|
160
|
+
|
|
161
|
+
def pop(self, key: str, default=None):
|
|
162
|
+
keys = key.split(".")
|
|
163
|
+
data = self._data
|
|
164
|
+
for key in keys[:-1]:
|
|
165
|
+
if not isinstance(data, dict) or key not in data:
|
|
166
|
+
return default
|
|
167
|
+
data = data[key]
|
|
168
|
+
if not isinstance(data, dict) or key not in data:
|
|
169
|
+
return default
|
|
170
|
+
return data.pop(key)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
class PropertyDict:
|
|
2
|
+
|
|
3
|
+
def __init__(self, data: dict | None):
|
|
4
|
+
self._data = data or {}
|
|
5
|
+
return
|
|
6
|
+
|
|
7
|
+
@property
|
|
8
|
+
def as_dict(self) -> dict:
|
|
9
|
+
"""The data as a dictionary."""
|
|
10
|
+
return self._data
|
|
11
|
+
|
|
12
|
+
def get(self, key, default=None):
|
|
13
|
+
return self._data.get(key, default)
|
|
14
|
+
|
|
15
|
+
def pop(self, key, default=None):
|
|
16
|
+
return self._data.pop(key, default)
|
|
17
|
+
|
|
18
|
+
def setdefault(self, key, default):
|
|
19
|
+
return self._data.setdefault(key, default)
|
|
20
|
+
|
|
21
|
+
def __getattr__(self, name: str):
|
|
22
|
+
return self._data[name]
|
|
23
|
+
|
|
24
|
+
def __getitem__(self, name: str):
|
|
25
|
+
return self._data[name]
|
|
26
|
+
|
|
27
|
+
def __setitem__(self, key, value):
|
|
28
|
+
self._data[key] = value
|
|
29
|
+
|
|
30
|
+
def __contains__(self, name: str):
|
|
31
|
+
return name in self._data
|
|
32
|
+
|
|
33
|
+
def __iter__(self):
|
|
34
|
+
return iter(self._data)
|
|
35
|
+
|
|
36
|
+
def __len__(self):
|
|
37
|
+
return len(self._data)
|
|
38
|
+
|
|
39
|
+
def __repr__(self):
|
|
40
|
+
return f"PropertyDict({self._data})"
|
|
41
|
+
|
|
42
|
+
def __str__(self):
|
|
43
|
+
return str(self._data)
|
|
44
|
+
|
|
45
|
+
def __eq__(self, other):
|
|
46
|
+
return self._data == other._data
|
|
47
|
+
|
|
48
|
+
def __ne__(self, other):
|
|
49
|
+
return self._data != other._data
|
|
File without changes
|