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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: json_repair
3
- Version: 0.25.1
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
+ [![PyPI](https://img.shields.io/pypi/v/json-repair)](https://pypi.org/project/json-repair/)
39
+ ![Python version](https://img.shields.io/badge/python-3.7+-important)
40
+ [![PyPI downloads](https://img.shields.io/pypi/dm/json-repair)](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
+ [![PyPI](https://img.shields.io/pypi/v/json-repair)](https://pypi.org/project/json-repair/)
2
+ ![Python version](https://img.shields.io/badge/python-3.7+-important)
3
+ [![PyPI downloads](https://img.shields.io/pypi/dm/json-repair)](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.1"
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
- # 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()
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.1
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
+ [![PyPI](https://img.shields.io/pypi/v/json-repair)](https://pypi.org/project/json-repair/)
39
+ ![Python version](https://img.shields.io/badge/python-3.7+-important)
40
+ [![PyPI downloads](https://img.shields.io/pypi/dm/json-repair)](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