Skip to content
URI Parsing for Humans.
Python
Failed to load latest commit information.
tests tests for IPV6 addresses with and without ports Jun 19, 2012
uricore
.gitignore add more to gitignore. May 13, 2012
.travis.yml no 3.2 for now Mar 14, 2012
LICENSE close #4 and add BSD license. May 13, 2012
MANIFEST.in close #4 and add BSD license. May 13, 2012
README.md add from_template to readme. Apr 10, 2012
setup.py use setuptools. May 13, 2012

README.md

urilib

Build Status

WARNING: Rough, raw, and fast changing code. Check back later. ;-)

Example of use:

>>> from httpcore.uri import URI
>>> from httpcore.iri import IRI
>>> iri = IRI(u'http://\N{SNOWMAN}/')
>>> iri
IRI(u'http://\u2603/')
>>> uri = URI(iri)
>>> uri
URI('http://xn--n3h/')
>>> iri.netloc
u'http://\u2603/'
>>> iri.hostname
'\u2603'
>>> iri.port is None
True
>>> iri.path
u'/'
>>> hasattr(iri, '__hash__')
True
>>> iri.replace(port=8000)
IRI(u'http://\u2603:8000/')
>>> iriq = iri.update_query({'foo': u'42'})
>>> iriq
IRI(u'http://\u2603/?foo=42')
>>> iriq.update_query(foo=None)
IRI(u'http://\u2603/')
>>> iriq.query
MultiDict([('foo', '42')])
>>> URI.from_template('http://{domain}/find{?year*}', domain="example.com",
... year=("1965", "2000", "2012"))
URI('http://example.com/find?year=1965&year=2000&year=2012')
Something went wrong with that request. Please try again.