Skip to main content

URI Parsing for Humans.

Project description

# urilib

[![Build Status](https://secure.travis-ci.org/core/uricore.png?branch=master)](http://travis-ci.org/core/uricore)

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')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uricore-0.1.0.tar.gz (1.5 kB view details)

Uploaded Source

File details

Details for the file uricore-0.1.0.tar.gz.

File metadata

  • Download URL: uricore-0.1.0.tar.gz
  • Upload date:
  • Size: 1.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for uricore-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eb4a29f543d43a870df023b5ace409002859cd500de96f723e2d75da6f765761
MD5 b0057210933673df493c0fb48935ed00
BLAKE2b-256 6f90eb6a73e353a7448559c1dccfb67344f7450c3483d84d3502ea76a7e23bcf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page