skip to navigation
skip to content

Not Logged In

uritools 0.11.1

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

Package Documentation

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
>>> parts = urisplit('foo://')
>>> parts
SplitResultString(scheme='foo', authority='',
                  path='/over/there', query='name=ferret', fragment='nose')
>>> parts.scheme
>>> parts.authority
>>> parts.userinfo
>>> parts.port
>>> uriunsplit(parts[:3] + ('name=swallow&type=African', 'beak'))
>>> urijoin('', 'FAQ.html')
>>> uridefrag('')
>>> urisplit('').gethost(encoding='idna')

For various reasons, the Python 2 urlparse module is not compliant with current Internet standards, does not include Unicode support, and is generally unusable with proprietary URI schemes. Python 3’s urllib.parse improves on Unicode support, but the other issues still remain. As stated in Lib/urllib/

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 conveniently composing URIs from their individual components.


Install uritools using pip:

pip install uritools


Copyright (c) 2014, 2015 Thomas Kemmer.

Licensed under the MIT License.

File Type Py Version Uploaded on Size
uritools-0.11.1-py2.py3-none-any.whl (md5) Python Wheel 2.7 2015-03-25 14KB
uritools-0.11.1.tar.gz (md5) Source 2015-03-25 16KB
  • Downloads (All Versions):
  • 62 downloads in the last day
  • 902 downloads in the last week
  • 2348 downloads in the last month