Example #1
0
File: io.py Project: ghuls/polars
def read_json(source: Union[str, BytesIO]) -> DataFrame:
    """
    Read into a DataFrame from JSON format.

    Parameters
    ----------
    source
        Path to a file or a file like object.
    """
    return DataFrame._read_json(source)
Example #2
0
def read_json(source: Union[str, IOBase], json_lines: bool = False) -> DataFrame:
    """
    Read into a DataFrame from JSON format.

    Parameters
    ----------
    source
        Path to a file or a file-like object.
    json_lines
        Toggle between "JSON" and "NDJSON" format
    """
    return DataFrame._read_json(source, json_lines)