Skip to main content

load_json

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

  • Description: Reads a JSON file. It uses ujson for faster reading compared to the standard json module.

  • Parameters:

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

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

    import capybara as cb

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