It's not very clear from you question, but it looks like your are searching for urllib. Note that urllib expects 8 bit strings, so you will need to do some fancy decode/encode. Welcome to python2 somewhat weird unicode support, pythn3 is way better.
# -*- coding: utf-8 -*-
import urllib
url=u'/home/javier/Área'
url2 = url.encode('utf-8') # urllib expects 8-bit string
url3 = urllib.quote_plus(url2)
print url3 # >> %2Fhome%2Fjavier%2F%C3%81rea
url4 = urllib.unquote(url3) # It will return a 8-bit string
print url4 # >> /home/javier/Área
print url4.decode('utf-8')
You can use urllib.qoute instead of *urllib.quote_plus*, it will not quote spaces, + (pluses) and / (slashes). Both functions accept a string as a second parameter, they will keep any character in that string as is (I mean it will not quote it) in the output string. Note that the default value for safe, the name of the second parameter, is '/' for quote and '' for quote_plus. If you don't include a slash in your second parameter quote will change it.
urllib.quote_plus('a/a','/') # 'a/a'