def add_url_params(url, params):
 url = unquote(url)
 parsed_url = urlparse(url)
 get_args = parsed_url.query
 parsed_get_args = dict(parse_qsl(get_args))
 parsed_get_args.update(params)
 parsed_get_args.update({k: dumps(v) for (k, v) in parsed_get_args.items() if isinstance(v, (bool, dict))})
 encoded_get_args = urlencode(parsed_get_args, doseq=True)
 new_url = ParseResult(parsed_url.scheme, parsed_url.netloc, parsed_url.path, parsed_url.params, encoded_get_args, parsed_url.fragment).geturl()
 return new_url

def add_url_params ( url , params ) : url = unquote ( url ) parsed_url = urlparse ( url ) get_args = parsed_url . query parsed_get_args = dict ( parse_qsl ( get_args ) ) parsed_get_args . update ( params ) parsed_get_args . update ( { k : dumps ( v ) for ( k , v ) in parsed_get_args . items ( ) if isinstance ( v , ( bool , dict ) ) } ) encoded_get_args = urlencode ( parsed_get_args , doseq = True ) new_url = ParseResult ( parsed_url . scheme , parsed_url . netloc , parsed_url . path , parsed_url . params , encoded_get_args , parsed_url . fragment ) . geturl ( ) return new_url
add get params to provided url being aware of existing .