gi2xl/utils/json_utils.py
def split_header(curl_output):
    """
    Splits the header and the json output from a curl call.

    Args:
        curl_output (str): output from curl call.

    Returns:
        tuple: tuple of header string and json.
    """

    # json content starts at the first open square bracket
    json_start_idx = curl_output.find("[")
    # convert string to json
    actual_json = json.loads(curl_output[json_start_idx:])

    return curl_output[:json_start_idx], actual_json

    Splits the header and the json output from a curl call.

    Args:
        curl_output (str): output from curl call.

    Returns:
        tuple: tuple of header string and json.
    
Splits the header and the json output from a curl call.
Splits the header and the json output from a curl call .
def split_header(curl_output):
    json_start_idx = curl_output.find("[")
    actual_json = json.loads(curl_output[json_start_idx:])
    return curl_output[:json_start_idx], actual_json
def split_header ( curl_output ) : json_start_idx = curl_output . find ( "[" ) actual_json = json . loads ( curl_output [ json_start_idx : ] ) return curl_output [ : json_start_idx ] , actual_json
Splits the header and the json output from a curl call.
Splits the header and the json output from a curl call .
"""
    Splits the header and the json output from a curl call.

    Args:
        curl_output (str): output from curl call.

    Returns:
        tuple: tuple of header string and json.
    """ # json content starts at the first open square bracket # convert string to json
tuple of header string and json.
tuple of header string and json .
tuple
curl_output
output from curl call.
output from curl call .