json-repair 0.45.0__tar.gz → 0.45.1__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.
Files changed (20) hide show
  1. {json_repair-0.45.0/src/json_repair.egg-info → json_repair-0.45.1}/PKG-INFO +3 -2
  2. {json_repair-0.45.0 → json_repair-0.45.1}/README.md +1 -0
  3. {json_repair-0.45.0 → json_repair-0.45.1}/pyproject.toml +3 -3
  4. {json_repair-0.45.0 → json_repair-0.45.1}/src/json_repair/json_parser.py +5 -0
  5. {json_repair-0.45.0 → json_repair-0.45.1/src/json_repair.egg-info}/PKG-INFO +3 -2
  6. {json_repair-0.45.0 → json_repair-0.45.1}/tests/test_json_repair.py +1 -0
  7. {json_repair-0.45.0 → json_repair-0.45.1}/LICENSE +0 -0
  8. {json_repair-0.45.0 → json_repair-0.45.1}/setup.cfg +0 -0
  9. {json_repair-0.45.0 → json_repair-0.45.1}/src/json_repair/__init__.py +0 -0
  10. {json_repair-0.45.0 → json_repair-0.45.1}/src/json_repair/__main__.py +0 -0
  11. {json_repair-0.45.0 → json_repair-0.45.1}/src/json_repair/json_context.py +0 -0
  12. {json_repair-0.45.0 → json_repair-0.45.1}/src/json_repair/json_repair.py +0 -0
  13. {json_repair-0.45.0 → json_repair-0.45.1}/src/json_repair/object_comparer.py +0 -0
  14. {json_repair-0.45.0 → json_repair-0.45.1}/src/json_repair/py.typed +0 -0
  15. {json_repair-0.45.0 → json_repair-0.45.1}/src/json_repair/string_file_wrapper.py +0 -0
  16. {json_repair-0.45.0 → json_repair-0.45.1}/src/json_repair.egg-info/SOURCES.txt +0 -0
  17. {json_repair-0.45.0 → json_repair-0.45.1}/src/json_repair.egg-info/dependency_links.txt +0 -0
  18. {json_repair-0.45.0 → json_repair-0.45.1}/src/json_repair.egg-info/entry_points.txt +0 -0
  19. {json_repair-0.45.0 → json_repair-0.45.1}/src/json_repair.egg-info/top_level.txt +0 -0
  20. {json_repair-0.45.0 → json_repair-0.45.1}/tests/test_performance.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: json_repair
3
- Version: 0.45.0
3
+ Version: 0.45.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
@@ -32,7 +32,7 @@ Keywords: JSON,REPAIR,LLM,PARSER
32
32
  Classifier: Programming Language :: Python :: 3
33
33
  Classifier: License :: OSI Approved :: MIT License
34
34
  Classifier: Operating System :: OS Independent
35
- Requires-Python: >=3.9
35
+ Requires-Python: >=3.10
36
36
  Description-Content-Type: text/markdown
37
37
  License-File: LICENSE
38
38
  Dynamic: license-file
@@ -103,6 +103,7 @@ then you can use use it in your code like this
103
103
  good_json_string = repair_json(bad_json_string)
104
104
  # If the string was super broken this will return an empty string
105
105
 
106
+
106
107
  You can use this library to completely replace `json.loads()`:
107
108
 
108
109
  import json_repair
@@ -64,6 +64,7 @@ then you can use use it in your code like this
64
64
  good_json_string = repair_json(bad_json_string)
65
65
  # If the string was super broken this will return an empty string
66
66
 
67
+
67
68
  You can use this library to completely replace `json.loads()`:
68
69
 
69
70
  import json_repair
@@ -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.45.0"
6
+ version = "0.45.1"
7
7
  license = {file = "LICENSE"}
8
8
  authors = [
9
9
  { name="Stefano Baccianella", email="4247706+mangiucugna@users.noreply.github.com" },
@@ -11,7 +11,7 @@ authors = [
11
11
  description = "A package to repair broken json strings"
12
12
  keywords = ["JSON", "REPAIR", "LLM", "PARSER"]
13
13
  readme = "README.md"
14
- requires-python = ">=3.9"
14
+ requires-python = ">=3.10"
15
15
  classifiers = [
16
16
  "Programming Language :: Python :: 3",
17
17
  "License :: OSI Approved :: MIT License",
@@ -101,4 +101,4 @@ line-ending = "auto"
101
101
 
102
102
  [tool.ruff.lint.per-file-ignores]
103
103
  # Explicit re-exports is fine in __init__.py, still a code smell elsewhere.
104
- "__init__.py" = ["PLC0414"]
104
+ "__init__.py" = ["PLC0414"]
@@ -790,6 +790,11 @@ class JSONParser:
790
790
  break
791
791
  self.log(f"Found block comment: {comment}")
792
792
  return ""
793
+ else:
794
+ # Skip standalone '/' characters that are not part of a comment
795
+ # to avoid getting stuck in an infinite loop
796
+ self.index += 1
797
+ return ""
793
798
  return "" # pragma: no cover
794
799
 
795
800
  def get_char_at(self, count: int = 0) -> str | Literal[False]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: json_repair
3
- Version: 0.45.0
3
+ Version: 0.45.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
@@ -32,7 +32,7 @@ Keywords: JSON,REPAIR,LLM,PARSER
32
32
  Classifier: Programming Language :: Python :: 3
33
33
  Classifier: License :: OSI Approved :: MIT License
34
34
  Classifier: Operating System :: OS Independent
35
- Requires-Python: >=3.9
35
+ Requires-Python: >=3.10
36
36
  Description-Content-Type: text/markdown
37
37
  License-File: LICENSE
38
38
  Dynamic: license-file
@@ -103,6 +103,7 @@ then you can use use it in your code like this
103
103
  good_json_string = repair_json(bad_json_string)
104
104
  # If the string was super broken this will return an empty string
105
105
 
106
+
106
107
  You can use this library to completely replace `json.loads()`:
107
108
 
108
109
  import json_repair
@@ -83,6 +83,7 @@ def test_general_edge_cases():
83
83
  assert repair_json("[[1\n\n]") == "[[1]]"
84
84
  assert repair_json("string") == ""
85
85
  assert repair_json("stringbeforeobject {}") == "{}"
86
+ assert repair_json("/") == ""
86
87
 
87
88
 
88
89
  def test_mixed_data_types():
File without changes
File without changes