json-repair 0.46.0__py3-none-any.whl → 0.46.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 +4 -1
- json_repair/object_comparer.py +1 -1
- {json_repair-0.46.0.dist-info → json_repair-0.46.1.dist-info}/METADATA +3 -2
- {json_repair-0.46.0.dist-info → json_repair-0.46.1.dist-info}/RECORD +8 -8
- {json_repair-0.46.0.dist-info → json_repair-0.46.1.dist-info}/WHEEL +1 -1
- {json_repair-0.46.0.dist-info → json_repair-0.46.1.dist-info}/entry_points.txt +0 -0
- {json_repair-0.46.0.dist-info → json_repair-0.46.1.dist-info}/licenses/LICENSE +0 -0
- {json_repair-0.46.0.dist-info → json_repair-0.46.1.dist-info}/top_level.txt +0 -0
json_repair/json_parser.py
CHANGED
@@ -41,7 +41,7 @@ class JSONParser:
|
|
41
41
|
self.log = self._log
|
42
42
|
else:
|
43
43
|
# No-op
|
44
|
-
self.log = lambda *args, **kwargs: None
|
44
|
+
self.log = lambda *args, **kwargs: None # noqa: ARG005
|
45
45
|
# When the json to be repaired is the accumulation of streaming json at a certain moment.
|
46
46
|
# e.g. json obtained from llm response.
|
47
47
|
# If this parameter to True will keep the repair results stable. For example:
|
@@ -67,6 +67,9 @@ class JSONParser:
|
|
67
67
|
# replace the last entry with the new one since the new one seems an update
|
68
68
|
json.pop()
|
69
69
|
json.append(j)
|
70
|
+
else:
|
71
|
+
# this was a bust, move the index
|
72
|
+
self.index += 1
|
70
73
|
# If nothing extra was found, don't return an array
|
71
74
|
if len(json) == 1:
|
72
75
|
self.log(
|
json_repair/object_comparer.py
CHANGED
@@ -6,7 +6,7 @@ class ObjectComparer: # pragma: no cover
|
|
6
6
|
pass # No operation performed in the constructor
|
7
7
|
|
8
8
|
@staticmethod
|
9
|
-
def is_same_object(obj1: Any, obj2: Any
|
9
|
+
def is_same_object(obj1: Any, obj2: Any) -> bool:
|
10
10
|
"""
|
11
11
|
Recursively compares two objects and ensures that:
|
12
12
|
- Their types match
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: json_repair
|
3
|
-
Version: 0.46.
|
3
|
+
Version: 0.46.1
|
4
4
|
Summary: A package to repair broken json strings
|
5
5
|
Author-email: Stefano Baccianella <4247706+mangiucugna@users.noreply.github.com>
|
6
6
|
License: MIT License
|
@@ -38,7 +38,7 @@ License-File: LICENSE
|
|
38
38
|
Dynamic: license-file
|
39
39
|
|
40
40
|
[](https://pypi.org/project/json-repair/)
|
41
|
-

|
42
42
|
[](https://pypi.org/project/json-repair/)
|
43
43
|
[](https://github.com/sponsors/mangiucugna)
|
44
44
|
[](https://github.com/mangiucugna/json_repair/stargazers)
|
@@ -289,6 +289,7 @@ You will need owner access to this repository
|
|
289
289
|
- Typescript: https://github.com/josdejong/jsonrepair
|
290
290
|
- Go: https://github.com/RealAlexandreAI/json-repair
|
291
291
|
- Ruby: https://github.com/sashazykov/json-repair-rb
|
292
|
+
- Rust: https://github.com/oramasearch/llm_json
|
292
293
|
---
|
293
294
|
## Star History
|
294
295
|
|
@@ -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=WsMOjqpGSr6aaDONcrk8UFtTurzWon2Qq9AoBBYseoI,934
|
4
|
-
json_repair/json_parser.py,sha256=
|
4
|
+
json_repair/json_parser.py,sha256=7IPu-tin9jLX_y1F9tn3UVpqILARhZYFaTTvq9xrLnU,40451
|
5
5
|
json_repair/json_repair.py,sha256=9wxf0vVNfr_RNQI1rbVPvxQ9feEwwvgnvkiYXwGEBX8,11292
|
6
|
-
json_repair/object_comparer.py,sha256=
|
6
|
+
json_repair/object_comparer.py,sha256=5-LK-s_2MAHddTxqXSzSkaIFvPXKGLh6swC1gyN74Lk,1245
|
7
7
|
json_repair/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
json_repair/string_file_wrapper.py,sha256=uwW4B1s9Cf-iF3ANsCz-RPu2ddCqDETrt8bdojh8ufA,4485
|
9
|
-
json_repair-0.46.
|
10
|
-
json_repair-0.46.
|
11
|
-
json_repair-0.46.
|
12
|
-
json_repair-0.46.
|
13
|
-
json_repair-0.46.
|
14
|
-
json_repair-0.46.
|
9
|
+
json_repair-0.46.1.dist-info/licenses/LICENSE,sha256=wrjQo8MhNrNCicXtMe3MHmS-fx8AmQk1ue8AQwiiFV8,1076
|
10
|
+
json_repair-0.46.1.dist-info/METADATA,sha256=y-p_aOKtX4eu7p-JNj6IO3s8svB06IityZRnRKEN_xE,12208
|
11
|
+
json_repair-0.46.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
12
|
+
json_repair-0.46.1.dist-info/entry_points.txt,sha256=SNfge3zPSP-ASqriYU9r3NAPaXdseYr7ciPMKdV2uSw,57
|
13
|
+
json_repair-0.46.1.dist-info/top_level.txt,sha256=7-VZwZN2CgB_n0NlSLk-rEUFh8ug21lESbsblOYuZqw,12
|
14
|
+
json_repair-0.46.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|