json-repair 0.41.0__py3-none-any.whl → 0.41.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.
- json_repair/json_parser.py +1 -1
- json_repair/object_comparer.py +0 -8
- {json_repair-0.41.0.dist-info → json_repair-0.41.1.dist-info}/METADATA +1 -1
- {json_repair-0.41.0.dist-info → json_repair-0.41.1.dist-info}/RECORD +8 -8
- {json_repair-0.41.0.dist-info → json_repair-0.41.1.dist-info}/WHEEL +0 -0
- {json_repair-0.41.0.dist-info → json_repair-0.41.1.dist-info}/entry_points.txt +0 -0
- {json_repair-0.41.0.dist-info → json_repair-0.41.1.dist-info}/licenses/LICENSE +0 -0
- {json_repair-0.41.0.dist-info → json_repair-0.41.1.dist-info}/top_level.txt +0 -0
json_repair/json_parser.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
from typing import Any, Dict, List, Literal, Optional, TextIO, Tuple, Union
|
2
2
|
|
3
3
|
from .json_context import ContextValues, JsonContext
|
4
|
-
from .string_file_wrapper import StringFileWrapper
|
5
4
|
from .object_comparer import ObjectComparer
|
5
|
+
from .string_file_wrapper import StringFileWrapper
|
6
6
|
|
7
7
|
JSONReturnType = Union[Dict[str, Any], List[Any], str, float, int, bool, None]
|
8
8
|
|
json_repair/object_comparer.py
CHANGED
@@ -14,9 +14,6 @@ class ObjectComparer:
|
|
14
14
|
"""
|
15
15
|
if type(obj1) is not type(obj2):
|
16
16
|
# Fail immediately if the types don't match
|
17
|
-
print(
|
18
|
-
f"Type mismatch at {path}: {type(obj1).__name__} vs {type(obj2).__name__}"
|
19
|
-
)
|
20
17
|
return False
|
21
18
|
|
22
19
|
if isinstance(obj1, dict) and isinstance(obj2, dict):
|
@@ -27,10 +24,8 @@ class ObjectComparer:
|
|
27
24
|
extra_keys2 = keys2 - keys1
|
28
25
|
|
29
26
|
if extra_keys1:
|
30
|
-
print(f"Extra keys in first object at {path}: {extra_keys1}")
|
31
27
|
return False
|
32
28
|
if extra_keys2:
|
33
|
-
print(f"Extra keys in second object at {path}: {extra_keys2}")
|
34
29
|
return False
|
35
30
|
|
36
31
|
# Recursively compare the common keys
|
@@ -44,7 +39,6 @@ class ObjectComparer:
|
|
44
39
|
# Compare lists
|
45
40
|
min_length = min(len(obj1), len(obj2))
|
46
41
|
if len(obj1) != len(obj2):
|
47
|
-
print(f"Length mismatch at {path}: {len(obj1)} vs {len(obj2)}")
|
48
42
|
return False
|
49
43
|
|
50
44
|
for i in range(min_length):
|
@@ -54,10 +48,8 @@ class ObjectComparer:
|
|
54
48
|
return False
|
55
49
|
|
56
50
|
if len(obj1) > len(obj2):
|
57
|
-
print(f"Extra items in first list at {path}: {obj1[min_length:]}")
|
58
51
|
return False
|
59
52
|
elif len(obj2) > len(obj1):
|
60
|
-
print(f"Extra items in second list at {path}: {obj2[min_length:]}")
|
61
53
|
return False
|
62
54
|
|
63
55
|
return True
|
@@ -1,14 +1,14 @@
|
|
1
1
|
json_repair/__init__.py,sha256=c4L2kZrHvWEKfj_ODU2naliNuvU6FlFVxtF0hbLe6s8,178
|
2
2
|
json_repair/__main__.py,sha256=EsJb-y89uZEvGQQg1GdIDWzfDwfOMvVekKEtdguQXCM,67
|
3
3
|
json_repair/json_context.py,sha256=mm6dOyrPJ1sDskTORZSXCW7W9-5veMlUKqXQ3Hw3EG4,971
|
4
|
-
json_repair/json_parser.py,sha256=
|
4
|
+
json_repair/json_parser.py,sha256=VnTlhPEuIynUt3gaAU2jpLJDddnPASxM941rYyMnGbo,38996
|
5
5
|
json_repair/json_repair.py,sha256=k-5HRRlCqrxNmJi0u1KE3IUeL4HXqi1XZ7oAL-NFDLo,10314
|
6
|
-
json_repair/object_comparer.py,sha256=
|
6
|
+
json_repair/object_comparer.py,sha256=SeicB6_N4BHAEPon7s2BELEaJc4oyR9ZhfX2RgPk6Bw,1682
|
7
7
|
json_repair/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
json_repair/string_file_wrapper.py,sha256=koZmdq2-Z5K7XF1bDqX6dEbNaVMJYcMTjq-aGe6NQvA,4526
|
9
|
-
json_repair-0.41.
|
10
|
-
json_repair-0.41.
|
11
|
-
json_repair-0.41.
|
12
|
-
json_repair-0.41.
|
13
|
-
json_repair-0.41.
|
14
|
-
json_repair-0.41.
|
9
|
+
json_repair-0.41.1.dist-info/licenses/LICENSE,sha256=wrjQo8MhNrNCicXtMe3MHmS-fx8AmQk1ue8AQwiiFV8,1076
|
10
|
+
json_repair-0.41.1.dist-info/METADATA,sha256=HnZgNiwsJJ3iwtFKgeccdm-yniRJnPq70kjcpQo6aw0,11860
|
11
|
+
json_repair-0.41.1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
12
|
+
json_repair-0.41.1.dist-info/entry_points.txt,sha256=SNfge3zPSP-ASqriYU9r3NAPaXdseYr7ciPMKdV2uSw,57
|
13
|
+
json_repair-0.41.1.dist-info/top_level.txt,sha256=7-VZwZN2CgB_n0NlSLk-rEUFh8ug21lESbsblOYuZqw,12
|
14
|
+
json_repair-0.41.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|