json-repair 0.25.1__tar.gz → 0.25.2__tar.gz
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-0.25.1/src/json_repair.egg-info → json_repair-0.25.2}/PKG-INFO +6 -1
- {json_repair-0.25.1 → json_repair-0.25.2}/README.md +5 -0
- {json_repair-0.25.1 → json_repair-0.25.2}/pyproject.toml +1 -1
- {json_repair-0.25.1 → json_repair-0.25.2}/src/json_repair/json_repair.py +9 -9
- {json_repair-0.25.1 → json_repair-0.25.2/src/json_repair.egg-info}/PKG-INFO +6 -1
- {json_repair-0.25.1 → json_repair-0.25.2}/tests/test_json_repair.py +1 -0
- {json_repair-0.25.1 → json_repair-0.25.2}/LICENSE +0 -0
- {json_repair-0.25.1 → json_repair-0.25.2}/setup.cfg +0 -0
- {json_repair-0.25.1 → json_repair-0.25.2}/src/json_repair/__init__.py +0 -0
- {json_repair-0.25.1 → json_repair-0.25.2}/src/json_repair.egg-info/SOURCES.txt +0 -0
- {json_repair-0.25.1 → json_repair-0.25.2}/src/json_repair.egg-info/dependency_links.txt +0 -0
- {json_repair-0.25.1 → json_repair-0.25.2}/src/json_repair.egg-info/top_level.txt +0 -0
- {json_repair-0.25.1 → json_repair-0.25.2}/tests/test_performance.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: json_repair
|
3
|
-
Version: 0.25.
|
3
|
+
Version: 0.25.2
|
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
|
@@ -35,6 +35,11 @@ Requires-Python: >=3.7
|
|
35
35
|
Description-Content-Type: text/markdown
|
36
36
|
License-File: LICENSE
|
37
37
|
|
38
|
+
[](https://pypi.org/project/json-repair/)
|
39
|
+

|
40
|
+
[](https://pypi.org/project/json-repair/)
|
41
|
+
|
42
|
+
|
38
43
|
This simple package can be used to fix an invalid json string. To know all cases in which this package will work, check out the unit test.
|
39
44
|
|
40
45
|
Inspired by https://github.com/josdejong/jsonrepair
|
@@ -1,3 +1,8 @@
|
|
1
|
+
[](https://pypi.org/project/json-repair/)
|
2
|
+

|
3
|
+
[](https://pypi.org/project/json-repair/)
|
4
|
+
|
5
|
+
|
1
6
|
This simple package can be used to fix an invalid json string. To know all cases in which this package will work, check out the unit test.
|
2
7
|
|
3
8
|
Inspired by https://github.com/josdejong/jsonrepair
|
@@ -3,7 +3,7 @@ requires = ["setuptools>=61.0"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
4
4
|
[project]
|
5
5
|
name = "json_repair"
|
6
|
-
version = "0.25.
|
6
|
+
version = "0.25.2"
|
7
7
|
license = {file = "LICENSE"}
|
8
8
|
authors = [
|
9
9
|
{ name="Stefano Baccianella", email="4247706+mangiucugna@users.noreply.github.com" },
|
@@ -513,15 +513,15 @@ class JSONParser:
|
|
513
513
|
break
|
514
514
|
i += 1
|
515
515
|
next_c = self.get_char_at(i)
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
516
|
+
# Only if we fail to find a ':' then we know this is misplaced quote
|
517
|
+
if next_c != ":":
|
518
|
+
self.log(
|
519
|
+
"While parsing a string, we a misplaced quote that would have closed the string but has a different meaning here, ignoring it",
|
520
|
+
"info",
|
521
|
+
)
|
522
|
+
string_acc += char
|
523
|
+
self.index += 1
|
524
|
+
char = self.get_char_at()
|
525
525
|
|
526
526
|
if (
|
527
527
|
char
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: json_repair
|
3
|
-
Version: 0.25.
|
3
|
+
Version: 0.25.2
|
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
|
@@ -35,6 +35,11 @@ Requires-Python: >=3.7
|
|
35
35
|
Description-Content-Type: text/markdown
|
36
36
|
License-File: LICENSE
|
37
37
|
|
38
|
+
[](https://pypi.org/project/json-repair/)
|
39
|
+

|
40
|
+
[](https://pypi.org/project/json-repair/)
|
41
|
+
|
42
|
+
|
38
43
|
This simple package can be used to fix an invalid json string. To know all cases in which this package will work, check out the unit test.
|
39
44
|
|
40
45
|
Inspired by https://github.com/josdejong/jsonrepair
|
@@ -102,6 +102,7 @@ def test_array_edge_cases():
|
|
102
102
|
assert repair_json("[1, 2, ... , 3]") == "[1, 2, 3]"
|
103
103
|
assert repair_json("[1, 2, '...', 3]") == '[1, 2, "...", 3]'
|
104
104
|
assert repair_json("[true, false, null, ...]") == '[true, false, null]'
|
105
|
+
assert repair_json('["a" "b" "c" 1') == '["a", "b", "c", 1]'
|
105
106
|
assert (
|
106
107
|
repair_json('{"employees":["John", "Anna",')
|
107
108
|
== '{"employees": ["John", "Anna"]}'
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|