Skip to main content

RFC 3986 compliant, Unicode-aware, scheme-agnostic replacement for urlparse

Project description

This module defines RFC 3986 compliant replacements for the most commonly used functions of the Python 2.7 Standard Library urlparse and Python 3 urllib.parse modules.

>>> from uritools import urisplit, uriunsplit, urijoin, uridefrag
>>> uri = urisplit('foo://')
>>> uri
SplitResult(scheme='foo', authority='', path='/over/there',
            query='name=ferret', fragment='nose')
>>> uri.scheme
>>> uri.authority
>>> uri.port
>>> uri.geturi()
>>> uriunsplit(uri[:3] + ('name=swallow&type=African', 'beak'))
>>> urijoin('', 'FAQ.html')
>>> uridefrag('')
>>> urisplit('').gethost(encoding='idna')

For various reasons, the urlparse module is not compliant with current Internet standards, does not include Unicode support, and is generally unusable with proprietary URI schemes. As stated in Lib/

RFC 3986 is considered the current standard and any future changes
to urlparse module should conform with it.  The urlparse module is
currently not entirely compliant with this RFC due to defacto
scenarios for parsing, and for backward compatibility purposes,
some parsing quirks from older RFCs are retained.

This module aims to provide fully RFC 3986 compliant replacements for some commonly used functions found in urlparse, plus additional functions for handling Unicode, normalizing URI paths, and conveniently composing URIs from their individual components.


Install uritools using pip:

pip install uritools


Copyright (c) 2014 Thomas Kemmer.

Licensed under the MIT License.

Known Bugs and Limitations

This modules does not handle IPv6 host addresses (yet).

Project details

Download files

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

Files for uritools, version 0.5.1
Filename, size File type Python version Upload date Hashes
Filename, size uritools-0.5.1.tar.gz (15.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page