json-repair 0.47.0__tar.gz → 0.47.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.
- {json_repair-0.47.0/src/json_repair.egg-info → json_repair-0.47.1}/PKG-INFO +5 -1
- {json_repair-0.47.0 → json_repair-0.47.1}/README.md +4 -0
- {json_repair-0.47.0 → json_repair-0.47.1}/pyproject.toml +1 -1
- {json_repair-0.47.0 → json_repair-0.47.1}/src/json_repair/json_repair.py +4 -4
- {json_repair-0.47.0 → json_repair-0.47.1/src/json_repair.egg-info}/PKG-INFO +5 -1
- {json_repair-0.47.0 → json_repair-0.47.1}/LICENSE +0 -0
- {json_repair-0.47.0 → json_repair-0.47.1}/setup.cfg +0 -0
- {json_repair-0.47.0 → json_repair-0.47.1}/src/json_repair/__init__.py +0 -0
- {json_repair-0.47.0 → json_repair-0.47.1}/src/json_repair/__main__.py +0 -0
- {json_repair-0.47.0 → json_repair-0.47.1}/src/json_repair/json_context.py +0 -0
- {json_repair-0.47.0 → json_repair-0.47.1}/src/json_repair/json_parser.py +0 -0
- {json_repair-0.47.0 → json_repair-0.47.1}/src/json_repair/object_comparer.py +0 -0
- {json_repair-0.47.0 → json_repair-0.47.1}/src/json_repair/py.typed +0 -0
- {json_repair-0.47.0 → json_repair-0.47.1}/src/json_repair/string_file_wrapper.py +0 -0
- {json_repair-0.47.0 → json_repair-0.47.1}/src/json_repair.egg-info/SOURCES.txt +0 -0
- {json_repair-0.47.0 → json_repair-0.47.1}/src/json_repair.egg-info/dependency_links.txt +0 -0
- {json_repair-0.47.0 → json_repair-0.47.1}/src/json_repair.egg-info/entry_points.txt +0 -0
- {json_repair-0.47.0 → json_repair-0.47.1}/src/json_repair.egg-info/top_level.txt +0 -0
- {json_repair-0.47.0 → json_repair-0.47.1}/tests/test_json_repair.py +0 -0
- {json_repair-0.47.0 → json_repair-0.47.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.47.
|
3
|
+
Version: 0.47.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
|
@@ -175,6 +175,10 @@ will return
|
|
175
175
|
|
176
176
|
{"test_chinese_ascii": "统一码"}
|
177
177
|
|
178
|
+
### JSON dumps parameters
|
179
|
+
|
180
|
+
More in general, `repair_json` will accept all parameters that `json.dumps` accepts and just pass them through (for example indent)
|
181
|
+
|
178
182
|
### Performance considerations
|
179
183
|
If you find this library too slow because is using `json.loads()` you can skip that by passing `skip_json_loads=True` to `repair_json`. Like:
|
180
184
|
|
@@ -136,6 +136,10 @@ will return
|
|
136
136
|
|
137
137
|
{"test_chinese_ascii": "统一码"}
|
138
138
|
|
139
|
+
### JSON dumps parameters
|
140
|
+
|
141
|
+
More in general, `repair_json` will accept all parameters that `json.dumps` accepts and just pass them through (for example indent)
|
142
|
+
|
139
143
|
### Performance considerations
|
140
144
|
If you find this library too slow because is using `json.loads()` you can skip that by passing `skip_json_loads=True` to `repair_json`. Like:
|
141
145
|
|
@@ -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.47.
|
6
|
+
version = "0.47.1"
|
7
7
|
license = {file = "LICENSE"}
|
8
8
|
authors = [
|
9
9
|
{ name="Stefano Baccianella", email="4247706+mangiucugna@users.noreply.github.com" },
|
@@ -37,9 +37,9 @@ def repair_json(
|
|
37
37
|
skip_json_loads: bool = False,
|
38
38
|
logging: bool = False,
|
39
39
|
json_fd: TextIO | None = None,
|
40
|
-
ensure_ascii: bool = True,
|
41
40
|
chunk_length: int = 0,
|
42
41
|
stream_stable: bool = False,
|
42
|
+
**json_dumps_args,
|
43
43
|
) -> str: ...
|
44
44
|
|
45
45
|
|
@@ -50,9 +50,9 @@ def repair_json(
|
|
50
50
|
skip_json_loads: bool = False,
|
51
51
|
logging: bool = False,
|
52
52
|
json_fd: TextIO | None = None,
|
53
|
-
ensure_ascii: bool = True,
|
54
53
|
chunk_length: int = 0,
|
55
54
|
stream_stable: bool = False,
|
55
|
+
**json_dumps_args,
|
56
56
|
) -> JSONReturnType | tuple[JSONReturnType, list[dict[str, str]]]: ...
|
57
57
|
|
58
58
|
|
@@ -62,9 +62,9 @@ def repair_json(
|
|
62
62
|
skip_json_loads: bool = False,
|
63
63
|
logging: bool = False,
|
64
64
|
json_fd: TextIO | None = None,
|
65
|
-
ensure_ascii: bool = True,
|
66
65
|
chunk_length: int = 0,
|
67
66
|
stream_stable: bool = False,
|
67
|
+
**json_dumps_args,
|
68
68
|
) -> JSONReturnType | tuple[JSONReturnType, list[dict[str, str]]]:
|
69
69
|
"""
|
70
70
|
Given a json formatted string, it will try to decode it and, if it fails, it will try to fix it.
|
@@ -96,7 +96,7 @@ def repair_json(
|
|
96
96
|
# Avoid returning only a pair of quotes if it's an empty string
|
97
97
|
elif parsed_json == "":
|
98
98
|
return ""
|
99
|
-
return json.dumps(parsed_json,
|
99
|
+
return json.dumps(parsed_json, **json_dumps_args)
|
100
100
|
|
101
101
|
|
102
102
|
def loads(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: json_repair
|
3
|
-
Version: 0.47.
|
3
|
+
Version: 0.47.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
|
@@ -175,6 +175,10 @@ will return
|
|
175
175
|
|
176
176
|
{"test_chinese_ascii": "统一码"}
|
177
177
|
|
178
|
+
### JSON dumps parameters
|
179
|
+
|
180
|
+
More in general, `repair_json` will accept all parameters that `json.dumps` accepts and just pass them through (for example indent)
|
181
|
+
|
178
182
|
### Performance considerations
|
179
183
|
If you find this library too slow because is using `json.loads()` you can skip that by passing `skip_json_loads=True` to `repair_json`. Like:
|
180
184
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|