def extract_params(query):
    """
    :param query: (str) eg: q=testerhome&encoding=utf-8
    :return:
        [
            {
                "key": "q",
                "value": "testerhome"
            },
            {
                 "key": "encoding",
                "value": "utf-8"
            }
        ]
    """
    params = []
    if not query:
        return params

    for i in query.split('&'):
        param = i.split('=')
        key = param[0]
        value = None
        if len(param) > 1:
            value = param[-1]
        params.append({
            'key': key,
            'value': value
        })
    return params