Skip to main content

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

Project description

Latest PyPI version Number of PyPI downloads

This module defines RFC 3986 compliant replacements for the most commonly used functions of the Python Standard Library urlparse module.

>>> from uritools import urisplit, uriunsplit, urijoin, uridefrag
>>> p = urisplit('foo://')
>>> p
SplitResult(scheme='foo', authority='',
            path='/over/there', query='name=ferret', fragment='nose')
>>> p.scheme
>>> p.authority
>>> p.port
>>> p.geturi()
>>> uriunsplit(['foo', '', '/over/there', None, None])
>>> urijoin('', 'FAQ.html')
>>> uridefrag('')

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.

The uritools 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.


To install uritools using pip:

pip install uritools


v0.2.0 (2014-02-18)

  • Add authority subcomponent attributes.
  • Return DefragResult from uridefrag().
  • Improve urisplit/uriunsplit edge case behavior.

v0.1.0 (2014-02-14)

  • Initial beta release.

Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
uritools-0.2.0.tar.gz (8.8 kB) Copy SHA256 hash SHA256 Source None

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 SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page