json-repair 0.15.0__py3-none-any.whl → 0.15.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.
@@ -453,27 +453,26 @@ def repair_json(
453
453
 
454
454
 
455
455
  def loads(
456
- json_str: str,
456
+ json_str: str, skip_json_loads: bool = False, logging: bool = False
457
457
  ) -> Union[Dict[str, Any], List[Any], str, float, int, bool, None]:
458
458
  """
459
459
  This function works like `json.loads()` except that it will fix your JSON in the process.
460
460
  It is a wrapper around the `repair_json()` function with `return_objects=True`.
461
461
  """
462
- return repair_json(json_str, True)
462
+ return repair_json(json_str, True, skip_json_loads, logging)
463
463
 
464
464
 
465
- def load(fp: TextIO) -> Union[Dict[str, Any], List[Any], str, float, int, bool, None]:
466
- return loads(fp.read())
465
+ def load(
466
+ fp: TextIO, skip_json_loads: bool = False, logging: bool = False
467
+ ) -> Union[Dict[str, Any], List[Any], str, float, int, bool, None]:
468
+ return loads(fp.read(), skip_json_loads, logging)
467
469
 
468
470
 
469
471
  def from_file(
470
- filename: str,
472
+ filename: str, skip_json_loads: bool = False, logging: bool = False
471
473
  ) -> Union[Dict[str, Any], List[Any], str, float, int, bool, None]:
472
474
  fd = open(filename)
473
- jsonobj = load(fd)
475
+ jsonobj = load(fd, skip_json_loads, logging)
474
476
  fd.close()
475
477
 
476
478
  return jsonobj
477
-
478
-
479
- print(repair_json('{ "key": "value", "key2": }', logging=True))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: json_repair
3
- Version: 0.15.0
3
+ Version: 0.15.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
@@ -0,0 +1,7 @@
1
+ json_repair/__init__.py,sha256=AlNie5y6BZBioGi5fzTAUvum_y0U5aL5aNsuQ_68LQc,175
2
+ json_repair/json_repair.py,sha256=oGD3DDU_Gni7HA25Mlnx4b5_b7c8F_kRSNrxAR3f9sk,19297
3
+ json_repair-0.15.1.dist-info/LICENSE,sha256=wrjQo8MhNrNCicXtMe3MHmS-fx8AmQk1ue8AQwiiFV8,1076
4
+ json_repair-0.15.1.dist-info/METADATA,sha256=Kpv-aRkvY2N4YOLS9z61lKtD5IeoN0qg74Z0-y7mHtk,7355
5
+ json_repair-0.15.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
6
+ json_repair-0.15.1.dist-info/top_level.txt,sha256=7-VZwZN2CgB_n0NlSLk-rEUFh8ug21lESbsblOYuZqw,12
7
+ json_repair-0.15.1.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- json_repair/__init__.py,sha256=AlNie5y6BZBioGi5fzTAUvum_y0U5aL5aNsuQ_68LQc,175
2
- json_repair/json_repair.py,sha256=ctuP4AaBrsWBzhF2Al-gX_itHcTG15cqU4Z56KYxNfA,19119
3
- json_repair-0.15.0.dist-info/LICENSE,sha256=wrjQo8MhNrNCicXtMe3MHmS-fx8AmQk1ue8AQwiiFV8,1076
4
- json_repair-0.15.0.dist-info/METADATA,sha256=bnhSr8AectNHH-ljyaqwIC5BqPkVf2uYwLHuNuUYpyQ,7355
5
- json_repair-0.15.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
6
- json_repair-0.15.0.dist-info/top_level.txt,sha256=7-VZwZN2CgB_n0NlSLk-rEUFh8ug21lESbsblOYuZqw,12
7
- json_repair-0.15.0.dist-info/RECORD,,