Skip to main content

load_json

load_json(path: Union[Path, str], **kwargs) -> dict

  • Description

    Read a JSON file. Here, ujson is used for reading because it is much faster than json.

  • Parameters

    • path (Union[Path, str]): The path to the JSON file.
    • **kwargs: Additional parameters for ujson.load.
  • Returns

    • dict: The content of the JSON file.
  • Example

    import docsaidkit as D

    path = '/path/to/your/json'
    data = D.load_json(path)
    print(data)
    # >>> {'key': 'value'}