Decoding Query String In Python

I have a query string which contains encoded Unicode characters, so I need decodeURIComponent equivalent in Python.
It was not as straightforward as I expected, but I managed to get it working by using this snippet.

keyword = urllib.unquote(request.args.get('keyword', '').encode('ascii')).decode('utf-8')