diff -Nru python-uritools-2.2.0/CHANGELOG.rst python-uritools-3.0.0/CHANGELOG.rst --- python-uritools-2.2.0/CHANGELOG.rst 1970-01-01 00:00:00.000000000 +0000 +++ python-uritools-3.0.0/CHANGELOG.rst 2019-12-15 19:41:56.000000000 +0000 @@ -0,0 +1,233 @@ +v3.0.0 (2019-12-15) +=================== + +- Require Python 3.5 or later. + + +v2.2.0 (2018-05-17) +=================== + +- Add URI classification methods and functions. + + +v2.1.1 (2018-05-13) +=================== + +- Treat URIs with invalid schemes as relative references. + + +v2.1.0 (2017-10-07) +=================== + +- Add ``SplitResult.getauthority()``. + +- Add optional ``errors`` parameter to ``SplitResult.gethost()``. + + +v2.0.1 (2017-09-13) +=================== + +- Officially support Python 3.6. + +- Move documentation to RTD. + +- Fix ``flake8`` checks. + + +v2.0.0 (2016-10-09) +=================== + +- Drop Python 3.2 support (breaking change). + +- No longer treat semicolons as query separators by default (breaking + change). + +- Add optional ``sep`` parameter to ``SplitResult.getquerydict()`` and + ``SplitResult.getquerylist()`` (breaks ``encoding`` when passed as + positional argument). + +- Add optional ``querysep`` parameter to ``uricompose()`` (breaks + ``encoding`` when passed as positional argument). + + +v1.0.2 (2016-04-08) +=================== + +- Fix ``uriencode()`` documentation and unit tests requiring the + ``safe`` parameter to be a ``bytes`` object. + + +v1.0.1 (2015-07-09) +=================== + +- Encode semicolon in query values passed to ``uricompose()``. + + +v1.0.0 (2015-06-12) +=================== + +- Fix use of URI references as base URIs in ``urijoin()`` and + ``SplitResult.transform()``. + +- Remove ``SplitResult.getaddrinfo()``. + +- Remove ``SplitResult.getauthority()``. + +- Remove ``SplitResult.gethostip()``; return ``ipaddress`` address +objects from ``SplitResult.gethost()`` instead. + +- Remove ``SplitResult.gethost()`` ``encoding`` parameter. + +- Remove query delimiter parameters. + +- Return normalized paths from ``SplitResult.getpath()``. + +- Convert character constants to strings. + + +v0.12.0 (2015-04-03) +==================== + +- Deprecate ``SplitResult.getaddrinfo()``. + +- Deprecate ``SplitResult.getauthority()``. + +- Deprecate ``SplitResult.gethost()`` and ``SplitResult.gethostip()`` + ``encoding`` parameter; always use ``utf-8`` instead. + +- Drop support for "bytes-like objects". + +- Remove ``DefragResult.base``. + + +v0.11.1 (2015-03-25) +==================== + +- Fix ``uricompose()`` for relative-path references with colons in the + first path segment. + + +v0.11.0 (2014-12-16) +==================== + +- Support ``encoding=None`` for ``uriencode()`` and ``uridecode()``. + +- Add optional ``errors`` parameter to decoding methods. + + +v0.10.1 (2014-11-30) +==================== + +- Make ``uricompose()`` return ``str`` on all Python versions. + + +v0.10.0 (2014-11-30) +==================== + +- Use ``ipaddress`` module for handling IPv4/IPv6 host addresses. + +- Add ``userinfo``, ``host`` and ``port`` keyword arguments to + ``uricompose()``. + +- Deprecate ``DefragResult.base``. + +- Feature freeze for v1.0. + + +v0.9.0 (2014-11-21) +=================== + +- Improve Python 3 support. + + +v0.8.0 (2014-11-04) +=================== + +- Fix ``uriencode()`` and ``uridecode()``. + +- Deprecate ``RE``, ``urinormpath()``, ``DefragResult.getbase()``. + +- Support non-string query values in ``uricompose()``. + + +v0.7.0 (2014-10-12) +=================== + +- Add optional port parameter to ``SplitResult.getaddrinfo()``. + +- Cache ``SplitResult.authority`` subcomponents. + + +v0.6.0 (2014-09-17) +=================== + +- Add basic IPv6 support. + +- Change ``SplitResult.port`` back to string, to distinguish between + empty and absent port components. + +- Remove ``querysep`` and ``sep`` parameters. + +- Do not raise ``ValueError`` if scheme is not well-formed. + +- Improve Python 3 support. + + +v0.5.2 (2014-08-06) +=================== + +- Fix empty port handling. + + +v0.5.1 (2014-06-22) +=================== + +- Add basic Python 3 support. + + +v0.5.0 (2014-06-21) +=================== + +- Add ``SplitResult.getaddrinfo()``. + +- Support query mappings and sequences in ``uricompose()``. + + +v0.4.0 (2014-03-20) +=================== + +- Fix ``SplitResult.port`` to return int (matching urlparse). + +- Add ``SplitResult.getquerylist(), SplitResult.getquerydict()``. + + +v0.3.0 (2014-03-02) +=================== + +- Add result object accessor methods. + +- Update documentation. + + +v0.2.1 (2014-02-24) +=================== + +- Fix IndexError in ``urinormpath()``. + +- Integrate Python 2.7.6 ``urlparse`` unit tests. + + +v0.2.0 (2014-02-18) +=================== + +- Add authority subcomponent attributes. + +- Return ``DefragResult`` from ``uridefrag()``. + +- Improve edge case behavior. + + +v0.1.0 (2014-02-14) +=================== + +- Initial beta release. diff -Nru python-uritools-2.2.0/CHANGES.rst python-uritools-3.0.0/CHANGES.rst --- python-uritools-2.2.0/CHANGES.rst 2018-05-17 20:38:09.000000000 +0000 +++ python-uritools-3.0.0/CHANGES.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,227 +0,0 @@ -v2.2.0 (2018-05-17) -------------------- - -- Add URI classification methods and functions. - - -v2.1.1 (2018-05-13) -------------------- - -- Treat URIs with invalid schemes as relative references. - - -v2.1.0 (2017-10-07) -------------------- - -- Add ``SplitResult.getauthority()``. - -- Add optional ``errors`` parameter to ``SplitResult.gethost()``. - - -v2.0.1 (2017-09-13) -------------------- - -- Officially support Python 3.6. - -- Move documentation to RTD. - -- Fix ``flake8`` checks. - - -v2.0.0 (2016-10-09) -------------------- - -- Drop Python 3.2 support (breaking change). - -- No longer treat semicolons as query separators by default (breaking - change). - -- Add optional ``sep`` parameter to ``SplitResult.getquerydict()`` and - ``SplitResult.getquerylist()`` (breaks ``encoding`` when passed as - positional argument). - -- Add optional ``querysep`` parameter to ``uricompose()`` (breaks - ``encoding`` when passed as positional argument). - - -v1.0.2 (2016-04-08) -------------------- - -- Fix ``uriencode()`` documentation and unit tests requiring the - ``safe`` parameter to be a ``bytes`` object. - - -v1.0.1 (2015-07-09) -------------------- - -- Encode semicolon in query values passed to ``uricompose()``. - - -v1.0.0 (2015-06-12) -------------------- - -- Fix use of URI references as base URIs in ``urijoin()`` and - ``SplitResult.transform()``. - -- Remove ``SplitResult.getaddrinfo()``. - -- Remove ``SplitResult.getauthority()``. - -- Remove ``SplitResult.gethostip()``; return ``ipaddress`` address -objects from ``SplitResult.gethost()`` instead. - -- Remove ``SplitResult.gethost()`` ``encoding`` parameter. - -- Remove query delimiter parameters. - -- Return normalized paths from ``SplitResult.getpath()``. - -- Convert character constants to strings. - - -v0.12.0 (2015-04-03) --------------------- - -- Deprecate ``SplitResult.getaddrinfo()``. - -- Deprecate ``SplitResult.getauthority()``. - -- Deprecate ``SplitResult.gethost()`` and ``SplitResult.gethostip()`` - ``encoding`` parameter; always use ``utf-8`` instead. - -- Drop support for "bytes-like objects". - -- Remove ``DefragResult.base``. - - -v0.11.1 (2015-03-25) --------------------- - -- Fix ``uricompose()`` for relative-path references with colons in the - first path segment. - - -v0.11.0 (2014-12-16) --------------------- - -- Support ``encoding=None`` for ``uriencode()`` and ``uridecode()``. - -- Add optional ``errors`` parameter to decoding methods. - - -v0.10.1 (2014-11-30) --------------------- - -- Make ``uricompose()`` return ``str`` on all Python versions. - - -v0.10.0 (2014-11-30) --------------------- - -- Use ``ipaddress`` module for handling IPv4/IPv6 host addresses. - -- Add ``userinfo``, ``host`` and ``port`` keyword arguments to - ``uricompose()``. - -- Deprecate ``DefragResult.base``. - -- Feature freeze for v1.0. - - -v0.9.0 (2014-11-21) -------------------- - -- Improve Python 3 support. - - -v0.8.0 (2014-11-04) -------------------- - -- Fix ``uriencode()`` and ``uridecode()``. - -- Deprecate ``RE``, ``urinormpath()``, ``DefragResult.getbase()``. - -- Support non-string query values in ``uricompose()``. - - -v0.7.0 (2014-10-12) -------------------- - -- Add optional port parameter to ``SplitResult.getaddrinfo()``. - -- Cache ``SplitResult.authority`` subcomponents. - - -v0.6.0 (2014-09-17) -------------------- - -- Add basic IPv6 support. - -- Change ``SplitResult.port`` back to string, to distinguish between - empty and absent port components. - -- Remove ``querysep`` and ``sep`` parameters. - -- Do not raise ``ValueError`` if scheme is not well-formed. - -- Improve Python 3 support. - - -v0.5.2 (2014-08-06) -------------------- - -- Fix empty port handling. - - -v0.5.1 (2014-06-22) -------------------- - -- Add basic Python 3 support. - - -v0.5.0 (2014-06-21) -------------------- - -- Add ``SplitResult.getaddrinfo()``. - -- Support query mappings and sequences in ``uricompose()``. - - -v0.4.0 (2014-03-20) -------------------- - -- Fix ``SplitResult.port`` to return int (matching urlparse). - -- Add ``SplitResult.getquerylist(), SplitResult.getquerydict()``. - - -v0.3.0 (2014-03-02) -------------------- - -- Add result object accessor methods. - -- Update documentation. - - -v0.2.1 (2014-02-24) -------------------- - -- Fix IndexError in ``urinormpath()``. - -- Integrate Python 2.7.6 ``urlparse`` unit tests. - - -v0.2.0 (2014-02-18) -------------------- - -- Add authority subcomponent attributes. - -- Return ``DefragResult`` from ``uridefrag()``. - -- Improve edge case behavior. - - -v0.1.0 (2014-02-14) -------------------- - -- Initial beta release. diff -Nru python-uritools-2.2.0/debian/changelog python-uritools-3.0.0/debian/changelog --- python-uritools-2.2.0/debian/changelog 2019-12-17 12:44:44.000000000 +0000 +++ python-uritools-3.0.0/debian/changelog 2019-12-25 08:06:43.000000000 +0000 @@ -1,8 +1,14 @@ -python-uritools (2.2.0-1build1) focal; urgency=medium +python-uritools (3.0.0-1) unstable; urgency=medium - * No-change rebuild to generate dependencies on python2. + [ Ondřej Nový ] + * Use debhelper-compat instead of debian/compat. + * Bump Standards-Version to 4.4.1. - -- Matthias Klose Tue, 17 Dec 2019 12:44:44 +0000 + [ Stein Magnus Jodal ] + * New upstream release + * Drop Python 2 support (Closes: #938243) + + -- Stein Magnus Jodal Wed, 25 Dec 2019 09:06:43 +0100 python-uritools (2.2.0-1) unstable; urgency=medium diff -Nru python-uritools-2.2.0/debian/compat python-uritools-3.0.0/debian/compat --- python-uritools-2.2.0/debian/compat 2018-05-01 21:13:10.000000000 +0000 +++ python-uritools-3.0.0/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -10 diff -Nru python-uritools-2.2.0/debian/control python-uritools-3.0.0/debian/control --- python-uritools-2.2.0/debian/control 2019-02-18 22:59:46.000000000 +0000 +++ python-uritools-3.0.0/debian/control 2019-12-25 08:06:43.000000000 +0000 @@ -3,51 +3,27 @@ Priority: optional Maintainer: Debian Python Modules Team Uploaders: Stein Magnus Jodal , -Build-Depends: debhelper (>= 10), +Build-Depends: debhelper-compat (= 10), dh-python, - python-all, - python-ipaddress, - python-pytest, - python-setuptools, python3-all, python3-pytest, python3-setuptools, python3-sphinx, -Standards-Version: 4.3.0 +Standards-Version: 4.4.1 Homepage: https://github.com/tkem/uritools Vcs-Git: https://salsa.debian.org/python-team/modules/python-uritools.git Vcs-Browser: https://salsa.debian.org/python-team/modules/python-uritools -Package: python-uritools -Architecture: all -Depends: ${misc:Depends}, - ${python:Depends}, - ${sphinxdoc:Depends}, -Built-Using: ${sphinxdoc:Built-Using}, -Description: RFC 3986 compliant replacement for urlparse (Python 2) - 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. - . - 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. - . - This module aims to provide fully RFC 3986 compliant replacements for some - commonly used functions found in urlparse and urllib.parse, plus additional - functions for conveniently composing URIs from their individual components. - Package: python3-uritools Architecture: all Depends: ${misc:Depends}, ${python3:Depends}, ${sphinxdoc:Depends}, Built-Using: ${sphinxdoc:Built-Using}, -Description: RFC 3986 compliant replacement for urlparse (Python 3) - 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. +Description: RFC 3986 compliant replacement for urlparse + This module provides RFC 3986 compliant functions for parsing, classifying and + composing URIs and URI references, largely replacing the Python Standard + Library's urllib.parse module. . For various reasons, the Python 2 urlparse module is not compliant with current Internet standards, does not include Unicode support, and is generally diff -Nru python-uritools-2.2.0/debian/copyright python-uritools-3.0.0/debian/copyright --- python-uritools-2.2.0/debian/copyright 2019-02-18 22:33:04.000000000 +0000 +++ python-uritools-3.0.0/debian/copyright 2019-12-25 08:06:43.000000000 +0000 @@ -4,7 +4,7 @@ Source: https://github.com/tkem/uritools Files: * -Copyright: 2014-2018 Thomas Kemmer +Copyright: 2014-2019 Thomas Kemmer License: Expat Files: debian/* diff -Nru python-uritools-2.2.0/debian/python-uritools.docs python-uritools-3.0.0/debian/python-uritools.docs --- python-uritools-2.2.0/debian/python-uritools.docs 2019-02-18 22:35:36.000000000 +0000 +++ python-uritools-3.0.0/debian/python-uritools.docs 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -README.rst -build/html diff -Nru python-uritools-2.2.0/debian/rules python-uritools-3.0.0/debian/rules --- python-uritools-2.2.0/debian/rules 2019-02-18 22:58:38.000000000 +0000 +++ python-uritools-3.0.0/debian/rules 2019-12-25 08:06:43.000000000 +0000 @@ -6,7 +6,7 @@ export PYBUILD_NAME=uritools %: - dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild + dh $@ --with python3,sphinxdoc --buildsystem=pybuild override_dh_auto_build: export http_proxy=127.0.0.1:9 override_dh_auto_build: export https_proxy=127.0.0.1:9 @@ -15,4 +15,4 @@ PYTHONPATH=. python3 -m sphinx -N -bhtml docs/ build/html override_dh_installchangelogs: - dh_installchangelogs CHANGES.rst + dh_installchangelogs CHANGELOG.rst diff -Nru python-uritools-2.2.0/docs/conf.py python-uritools-3.0.0/docs/conf.py --- python-uritools-2.2.0/docs/conf.py 2018-05-13 16:32:29.000000000 +0000 +++ python-uritools-3.0.0/docs/conf.py 2019-12-15 19:30:14.000000000 +0000 @@ -1,13 +1,16 @@ -def get_version(filename): - from re import findall - with open(filename) as f: - metadata = dict(findall(r"__([a-z]+)__ = '([^']+)'", f.read())) - return metadata['version'] +def get_version(): + import configparser + import pathlib + + cp = configparser.ConfigParser() + # Python 3.5 ConfigParser does not accept Path as filename + cp.read(str(pathlib.Path(__file__).parent.parent / "setup.cfg")) + return cp["metadata"]["version"] project = 'uritools' -copyright = '2014-2018 Thomas Kemmer' -version = get_version(b'../uritools/__init__.py') +copyright = '2014-2019 Thomas Kemmer' +version = get_version() release = version extensions = [ diff -Nru python-uritools-2.2.0/docs/index.rst python-uritools-3.0.0/docs/index.rst --- python-uritools-2.2.0/docs/index.rst 2018-05-17 20:38:09.000000000 +0000 +++ python-uritools-3.0.0/docs/index.rst 2019-12-15 19:30:14.000000000 +0000 @@ -1,13 +1,14 @@ -:mod:`uritools` --- RFC 3986 compliant replacement for :mod:`urlparse` -======================================================================= +*************************************************************** +:mod:`uritools` --- URI parsing, classification and composition +*************************************************************** .. module:: uritools -This module defines RFC 3986 compliant replacements for the most -commonly used functions of the Python 2.7 Standard Library -:mod:`urlparse` and Python 3 :mod:`urllib.parse` modules. +This module provides RFC 3986 compliant functions for parsing, +classifying and composing URIs and URI references, largely replacing +the Python Standard Library's :mod:`urllib.parse` module. -.. code-block:: pycon +.. doctest:: >>> from uritools import uricompose, urijoin, urisplit, uriunsplit >>> uricompose(scheme='foo', host='example.com', port=8042, @@ -23,15 +24,17 @@ 8042 >>> parts.getquerydict().get('name') ['ferret'] + >>> parts.isuri() + True + >>> parts.isabsuri() + False >>> urijoin(uriunsplit(parts), '/right/here?name=swallow#beak') 'foo://example.com:8042/right/here?name=swallow#beak' -For various reasons, the Python 2 :mod:`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 :mod:`urllib.parse` improves on Unicode support, but the -other issues still remain. As stated in `Lib/urllib/parse.py -`_:: +For various reasons, :mod:`urllib.parse` and its Python 2 predecessor +:mod:`urlparse` are not compliant with current Internet standards. As +stated in `Lib/urllib/parse.py +`_: RFC 3986 is considered the current standard and any future changes to urlparse module should conform with it. The urlparse module is @@ -40,9 +43,10 @@ some parsing quirks from older RFCs are retained. This module aims to provide fully RFC 3986 compliant replacements for -the most commonly used functions found in :mod:`urlparse` and -:mod:`urllib.parse`, plus additional functions for conveniently -composing URIs from their individual components. +the most commonly used functions found in :mod:`urllib.parse`. It +also includes functions for distinguishing between the different forms +of URIs and URI references, and for conveniently creating URIs from +their individual components. .. seealso:: @@ -54,7 +58,7 @@ URI Classification ------------------------------------------------------------------------- +================== According to RFC 3986, a URI reference is either a URI or a *relative reference*. If the URI reference's prefix does not match the syntax @@ -92,7 +96,7 @@ URI Composition ------------------------------------------------------------------------- +=============== .. autofunction:: uricompose @@ -120,7 +124,7 @@ URI Decomposition ------------------------------------------------------------------------- +================= .. autofunction:: uridefrag @@ -174,7 +178,7 @@ URI Encoding ------------------------------------------------------------------------- +============ .. autofunction:: uridecode @@ -193,7 +197,7 @@ Structured Parse Results ------------------------------------------------------------------------- +======================== The result objects from the :func:`uridefrag` and :func:`urisplit` functions are instances of subclasses of @@ -209,7 +213,7 @@ Character Constants ------------------------------------------------------------------------- +=================== .. data:: GEN_DELIMS diff -Nru python-uritools-2.2.0/LICENSE python-uritools-3.0.0/LICENSE --- python-uritools-2.2.0/LICENSE 2018-05-13 16:32:29.000000000 +0000 +++ python-uritools-3.0.0/LICENSE 2019-12-15 19:30:14.000000000 +0000 @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-2018 Thomas Kemmer +Copyright (c) 2014-2019 Thomas Kemmer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff -Nru python-uritools-2.2.0/MANIFEST.in python-uritools-3.0.0/MANIFEST.in --- python-uritools-2.2.0/MANIFEST.in 2016-06-27 17:35:47.000000000 +0000 +++ python-uritools-3.0.0/MANIFEST.in 2019-12-15 19:30:14.000000000 +0000 @@ -1,4 +1,4 @@ -include CHANGES.rst +include CHANGELOG.rst include LICENSE include MANIFEST.in include README.rst diff -Nru python-uritools-2.2.0/PKG-INFO python-uritools-3.0.0/PKG-INFO --- python-uritools-2.2.0/PKG-INFO 2018-05-17 20:39:18.000000000 +0000 +++ python-uritools-3.0.0/PKG-INFO 2019-12-15 19:42:32.000000000 +0000 @@ -1,18 +1,37 @@ -Metadata-Version: 1.1 +Metadata-Version: 1.2 Name: uritools -Version: 2.2.0 -Summary: RFC 3986 compliant, Unicode-aware, scheme-agnostic replacement for urlparse +Version: 3.0.0 +Summary: URI parsing, classification and composition Home-page: https://github.com/tkem/uritools/ Author: Thomas Kemmer Author-email: tkemmer@computer.org License: MIT -Description-Content-Type: UNKNOWN Description: uritools ======================================================================== - 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. + .. image:: https://img.shields.io/pypi/v/uritools + :target: https://pypi.org/project/uritools + :alt: Latest PyPI version + + .. image:: https://img.shields.io/readthedocs/uritools + :target: https://uritools.readthedocs.io + :alt: Documentation build status + + .. image:: https://img.shields.io/travis/tkem/uritools + :target: https://travis-ci.org/tkem/uritools + :alt: Travis CI build status + + .. image:: https://img.shields.io/coveralls/tkem/uritools + :target: https://coveralls.io/r/tkem/uritools + :alt: Test coverage + + .. image:: https://img.shields.io/github/license/tkem/uritools + :target: http://raw.github.com/tkem/uritools/master/LICENSE + :alt: License + + This module provides RFC 3986 compliant functions for parsing, + classifying and composing URIs and URI references, largely replacing + the Python Standard Library's ``urllib.parse`` module. .. code-block:: pycon @@ -30,15 +49,17 @@ 8042 >>> parts.getquerydict().get('name') ['ferret'] + >>> parts.isuri() + True + >>> parts.isabsuri() + False >>> urijoin(uriunsplit(parts), '/right/here?name=swallow#beak') 'foo://example.com:8042/right/here?name=swallow#beak' - 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/parse.py - `_:: + For various reasons, ``urllib.parse`` and its Python 2 predecessor + ``urlparse`` are not compliant with current Internet standards. As + stated in `Lib/urllib/parse.py + `_: RFC 3986 is considered the current standard and any future changes to urlparse module should conform with it. The urlparse module is @@ -47,57 +68,44 @@ 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`` and - ``urllib.parse``, plus additional functions for conveniently composing - URIs from their individual components. + the most commonly used functions found in ``urllib.parse``. It also + includes functions for distinguishing between the different forms of + URIs and URI references, and for conveniently creating URIs from their + individual components. Installation ------------------------------------------------------------------------ - Install uritools using pip:: + uritools is available from PyPI_ and can be installed by running:: - pip install uritools + pip install uritools Project Resources ------------------------------------------------------------------------ - .. image:: http://img.shields.io/pypi/v/uritools.svg?style=flat - :target: https://pypi.python.org/pypi/uritools/ - :alt: Latest PyPI version - - .. image:: http://img.shields.io/travis/tkem/uritools/master.svg?style=flat - :target: https://travis-ci.org/tkem/uritools/ - :alt: Travis CI build status - - .. image:: http://img.shields.io/coveralls/tkem/uritools/master.svg?style=flat - :target: https://coveralls.io/r/tkem/uritools - :alt: Test coverage - - .. image:: https://readthedocs.org/projects/uritools/badge/?version=latest&style=flat - :target: http://uritools.readthedocs.io/en/latest/ - :alt: Documentation Status - - - `Issue Tracker`_ - - `Source Code`_ - - `Change Log`_ + - `Documentation`_ + - `Issue tracker`_ + - `Source code`_ + - `Change log`_ License ------------------------------------------------------------------------ - Copyright (c) 2014-2018 Thomas Kemmer. + Copyright (c) 2014-2019 Thomas Kemmer. Licensed under the `MIT License`_. - .. _Issue Tracker: https://github.com/tkem/uritools/issues/ - .. _Source Code: https://github.com/tkem/uritools/ - .. _Change Log: https://github.com/tkem/uritools/blob/master/CHANGES.rst + .. _PyPI: https://pypi.org/project/uritools/ + .. _Documentation: https://uritools.readthedocs.io/ + .. _Issue tracker: https://github.com/tkem/uritools/issues/ + .. _Source code: https://github.com/tkem/uritools/ + .. _Change log: https://github.com/tkem/uritools/blob/master/CHANGELOG.rst .. _MIT License: http://raw.github.com/tkem/uritools/master/LICENSE -Keywords: uri url urlparse urlsplit urljoin urldefrag Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Other Environment @@ -105,12 +113,10 @@ Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 -Classifier: Topic :: Internet +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Topic :: Software Development :: Libraries :: Python Modules +Requires-Python: ~=3.5 diff -Nru python-uritools-2.2.0/README.rst python-uritools-3.0.0/README.rst --- python-uritools-2.2.0/README.rst 2018-05-13 16:32:29.000000000 +0000 +++ python-uritools-3.0.0/README.rst 2019-12-15 19:30:14.000000000 +0000 @@ -1,9 +1,29 @@ uritools ======================================================================== -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. +.. image:: https://img.shields.io/pypi/v/uritools + :target: https://pypi.org/project/uritools + :alt: Latest PyPI version + +.. image:: https://img.shields.io/readthedocs/uritools + :target: https://uritools.readthedocs.io + :alt: Documentation build status + +.. image:: https://img.shields.io/travis/tkem/uritools + :target: https://travis-ci.org/tkem/uritools + :alt: Travis CI build status + +.. image:: https://img.shields.io/coveralls/tkem/uritools + :target: https://coveralls.io/r/tkem/uritools + :alt: Test coverage + +.. image:: https://img.shields.io/github/license/tkem/uritools + :target: http://raw.github.com/tkem/uritools/master/LICENSE + :alt: License + +This module provides RFC 3986 compliant functions for parsing, +classifying and composing URIs and URI references, largely replacing +the Python Standard Library's ``urllib.parse`` module. .. code-block:: pycon @@ -21,15 +41,17 @@ 8042 >>> parts.getquerydict().get('name') ['ferret'] + >>> parts.isuri() + True + >>> parts.isabsuri() + False >>> urijoin(uriunsplit(parts), '/right/here?name=swallow#beak') 'foo://example.com:8042/right/here?name=swallow#beak' -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/parse.py -`_:: +For various reasons, ``urllib.parse`` and its Python 2 predecessor +``urlparse`` are not compliant with current Internet standards. As +stated in `Lib/urllib/parse.py +`_: RFC 3986 is considered the current standard and any future changes to urlparse module should conform with it. The urlparse module is @@ -38,52 +60,40 @@ 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`` and -``urllib.parse``, plus additional functions for conveniently composing -URIs from their individual components. +the most commonly used functions found in ``urllib.parse``. It also +includes functions for distinguishing between the different forms of +URIs and URI references, and for conveniently creating URIs from their +individual components. Installation ------------------------------------------------------------------------ -Install uritools using pip:: +uritools is available from PyPI_ and can be installed by running:: - pip install uritools + pip install uritools Project Resources ------------------------------------------------------------------------ -.. image:: http://img.shields.io/pypi/v/uritools.svg?style=flat - :target: https://pypi.python.org/pypi/uritools/ - :alt: Latest PyPI version - -.. image:: http://img.shields.io/travis/tkem/uritools/master.svg?style=flat - :target: https://travis-ci.org/tkem/uritools/ - :alt: Travis CI build status - -.. image:: http://img.shields.io/coveralls/tkem/uritools/master.svg?style=flat - :target: https://coveralls.io/r/tkem/uritools - :alt: Test coverage - -.. image:: https://readthedocs.org/projects/uritools/badge/?version=latest&style=flat - :target: http://uritools.readthedocs.io/en/latest/ - :alt: Documentation Status - -- `Issue Tracker`_ -- `Source Code`_ -- `Change Log`_ +- `Documentation`_ +- `Issue tracker`_ +- `Source code`_ +- `Change log`_ License ------------------------------------------------------------------------ -Copyright (c) 2014-2018 Thomas Kemmer. +Copyright (c) 2014-2019 Thomas Kemmer. Licensed under the `MIT License`_. -.. _Issue Tracker: https://github.com/tkem/uritools/issues/ -.. _Source Code: https://github.com/tkem/uritools/ -.. _Change Log: https://github.com/tkem/uritools/blob/master/CHANGES.rst +.. _PyPI: https://pypi.org/project/uritools/ +.. _Documentation: https://uritools.readthedocs.io/ +.. _Issue tracker: https://github.com/tkem/uritools/issues/ +.. _Source code: https://github.com/tkem/uritools/ +.. _Change log: https://github.com/tkem/uritools/blob/master/CHANGELOG.rst .. _MIT License: http://raw.github.com/tkem/uritools/master/LICENSE diff -Nru python-uritools-2.2.0/setup.cfg python-uritools-3.0.0/setup.cfg --- python-uritools-2.2.0/setup.cfg 2018-05-17 20:39:18.000000000 +0000 +++ python-uritools-3.0.0/setup.cfg 2019-12-15 19:42:32.000000000 +0000 @@ -1,19 +1,44 @@ -[flake8] -exclude = .git,.tox +[metadata] +name = uritools +version = 3.0.0 +url = https://github.com/tkem/uritools/ +author = Thomas Kemmer +author_email = tkemmer@computer.org +license = MIT +license_file = LICENSE +description = URI parsing, classification and composition +long_description = file: README.rst +classifiers = + Development Status :: 5 - Production/Stable + Environment :: Other Environment + Intended Audience :: Developers + License :: OSI Approved :: MIT License + Operating System :: OS Independent + Programming Language :: Python + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Topic :: Software Development :: Libraries :: Python Modules + +[options] +packages = find: +python_requires = ~= 3.5 + +[options.packages.find] +exclude = + tests + tests.* -[wheel] -universal = 1 +[flake8] +exclude = .git, .tox [build_sphinx] source-dir = docs/ build-dir = docs/_build all_files = 1 -[upload_sphinx] -upload-dir = docs/_build/html - -[tool:pytest] - [egg_info] tag_build = tag_date = 0 diff -Nru python-uritools-2.2.0/setup.py python-uritools-3.0.0/setup.py --- python-uritools-2.2.0/setup.py 2017-09-13 21:09:59.000000000 +0000 +++ python-uritools-3.0.0/setup.py 2019-12-15 19:30:14.000000000 +0000 @@ -1,54 +1,3 @@ -import sys +from setuptools import setup -from setuptools import find_packages, setup - -# environment markers require a recent setuptools and/or pip version -if sys.version_info >= (3, 3) or 'bdist_wheel' in sys.argv: - install_requires = [] -else: - install_requires = ['ipaddress'] - - -def get_version(filename): - from re import findall - with open(filename) as f: - metadata = dict(findall("__([a-z]+)__ = '([^']+)'", f.read())) - return metadata['version'] - - -setup( - name='uritools', - version=get_version('uritools/__init__.py'), - url='https://github.com/tkem/uritools/', - license='MIT', - author='Thomas Kemmer', - author_email='tkemmer@computer.org', - description=( - 'RFC 3986 compliant, Unicode-aware, scheme-agnostic ' - 'replacement for urlparse' - ), - long_description=open('README.rst').read(), - keywords='uri url urlparse urlsplit urljoin urldefrag', - packages=find_packages(exclude=['tests', 'tests.*']), - install_requires=install_requires, - extras_require={ - ':python_version == "2.7"': ['ipaddress'] - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Other Environment', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Topic :: Internet', - 'Topic :: Software Development :: Libraries :: Python Modules' - ] -) +setup() diff -Nru python-uritools-2.2.0/tests/test_classify.py python-uritools-3.0.0/tests/test_classify.py --- python-uritools-2.2.0/tests/test_classify.py 2018-05-17 20:38:09.000000000 +0000 +++ python-uritools-3.0.0/tests/test_classify.py 2019-12-15 19:30:14.000000000 +0000 @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import unittest import uritools diff -Nru python-uritools-2.2.0/tests/test_compose.py python-uritools-3.0.0/tests/test_compose.py --- python-uritools-2.2.0/tests/test_compose.py 2016-10-09 16:52:32.000000000 +0000 +++ python-uritools-3.0.0/tests/test_compose.py 2019-12-15 19:30:14.000000000 +0000 @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import ipaddress import unittest diff -Nru python-uritools-2.2.0/tests/test_defrag.py python-uritools-3.0.0/tests/test_defrag.py --- python-uritools-2.2.0/tests/test_defrag.py 2016-06-27 17:35:47.000000000 +0000 +++ python-uritools-3.0.0/tests/test_defrag.py 2019-12-15 19:30:14.000000000 +0000 @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import unittest from uritools import uridefrag diff -Nru python-uritools-2.2.0/tests/test_encoding.py python-uritools-3.0.0/tests/test_encoding.py --- python-uritools-2.2.0/tests/test_encoding.py 2016-06-27 17:35:47.000000000 +0000 +++ python-uritools-3.0.0/tests/test_encoding.py 2019-12-15 19:30:14.000000000 +0000 @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import unittest from uritools import RESERVED, UNRESERVED, uridecode, uriencode diff -Nru python-uritools-2.2.0/tests/test_join.py python-uritools-3.0.0/tests/test_join.py --- python-uritools-2.2.0/tests/test_join.py 2016-06-27 17:35:47.000000000 +0000 +++ python-uritools-3.0.0/tests/test_join.py 2019-12-15 19:30:14.000000000 +0000 @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import unittest from uritools import urijoin diff -Nru python-uritools-2.2.0/tests/test_split.py python-uritools-3.0.0/tests/test_split.py --- python-uritools-2.2.0/tests/test_split.py 2018-05-17 18:43:56.000000000 +0000 +++ python-uritools-3.0.0/tests/test_split.py 2019-12-15 19:30:14.000000000 +0000 @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import unittest from uritools import urisplit diff -Nru python-uritools-2.2.0/tests/test_unsplit.py python-uritools-3.0.0/tests/test_unsplit.py --- python-uritools-2.2.0/tests/test_unsplit.py 2016-06-27 17:35:47.000000000 +0000 +++ python-uritools-3.0.0/tests/test_unsplit.py 2019-12-15 19:30:14.000000000 +0000 @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import unittest from uritools import uriunsplit diff -Nru python-uritools-2.2.0/tox.ini python-uritools-3.0.0/tox.ini --- python-uritools-2.2.0/tox.ini 2017-09-13 21:09:59.000000000 +0000 +++ python-uritools-3.0.0/tox.ini 2019-12-15 19:30:14.000000000 +0000 @@ -1,5 +1,5 @@ [tox] -envlist = check-manifest,docs,flake8,py +envlist = check-manifest,docs,doctest,flake8,py [testenv] deps = @@ -22,6 +22,12 @@ commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html +[testenv:doctest] +deps = + sphinx +commands = + sphinx-build -W -b doctest -d {envtmpdir}/doctrees docs {envtmpdir}/doctest + [testenv:flake8] deps = flake8 diff -Nru python-uritools-2.2.0/uritools/compose.py python-uritools-3.0.0/uritools/compose.py --- python-uritools-2.2.0/uritools/compose.py 2018-05-17 20:38:09.000000000 +0000 +++ python-uritools-3.0.0/uritools/compose.py 2019-12-15 19:30:14.000000000 +0000 @@ -1,4 +1,5 @@ import collections +import collections.abc import ipaddress import numbers import re @@ -7,15 +8,12 @@ from .encoding import uriencode from .split import uriunsplit -_unicode = type(u'') -_strtypes = (bytes, _unicode) - # RFC 3986 3.1: scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) _SCHEME_RE = re.compile(b'^[A-Za-z][A-Za-z0-9+.-]*$') # RFC 3986 3.2: authority = [ userinfo "@" ] host [ ":" port ] _AUTHORITY_RE_BYTES = re.compile(b'^(?:(.*)@)?(.*?)(?::([0-9]*))?$') -_AUTHORITY_RE_UNICODE = re.compile(u'^(?:(.*)@)?(.*?)(?::([0-9]*))?$') +_AUTHORITY_RE_STR = re.compile(u'^(?:(.*)@)?(.*?)(?::([0-9]*))?$') # safe component characters _SAFE_USERINFO = SUB_DELIMS + ':' @@ -99,22 +97,19 @@ name = uriencode(key, safe, encoding) if value is None: append(name) - elif isinstance(value, _strtypes): + elif isinstance(value, (bytes, str)): append(name + b'=' + uriencode(value, safe, encoding)) else: append(name + b'=' + uriencode(str(value), safe, encoding)) - if isinstance(sep, bytes): - return sep.join(terms) - else: - return sep.encode('ascii').join(terms) + return sep.encode('ascii').join(terms) def _querydict(mapping, sep, encoding): items = [] for key, value in mapping.items(): - if isinstance(value, _strtypes): + if isinstance(value, (bytes, str)): items.append((key, value)) - elif isinstance(value, collections.Iterable): + elif isinstance(value, collections.abc.Iterable): items.extend([(key, v) for v in value]) else: items.append((key, value)) @@ -145,9 +140,9 @@ authority = (None, None, None) elif isinstance(authority, bytes): authority = _AUTHORITY_RE_BYTES.match(authority).groups() - elif isinstance(authority, _unicode): - authority = _AUTHORITY_RE_UNICODE.match(authority).groups() - elif not isinstance(authority, collections.Iterable): + elif isinstance(authority, str): + authority = _AUTHORITY_RE_STR.match(authority).groups() + elif not isinstance(authority, collections.abc.Iterable): raise TypeError('Invalid authority type') elif len(authority) != 3: raise ValueError('Invalid authority length') @@ -188,11 +183,11 @@ # pairs and one frequently used value is a reference to another # URI, it is sometimes better for usability to avoid percent- # encoding those characters. - if isinstance(query, _strtypes): + if isinstance(query, (bytes, str)): query = uriencode(query, _SAFE_QUERY, encoding) - elif isinstance(query, collections.Mapping): + elif isinstance(query, collections.abc.Mapping): query = _querydict(query, querysep, encoding) - elif isinstance(query, collections.Iterable): + elif isinstance(query, collections.abc.Iterable): query = _querylist(query, querysep, encoding) elif query is not None: raise TypeError('Invalid query type') @@ -205,6 +200,5 @@ if fragment is not None: fragment = uriencode(fragment, _SAFE_FRAGMENT, encoding) - result = uriunsplit((scheme, authority, path, query, fragment)) - # always return platform `str` type - return result if isinstance(result, str) else result.decode() + # return URI reference as `str` + return uriunsplit((scheme, authority, path, query, fragment)).decode() diff -Nru python-uritools-2.2.0/uritools/encoding.py python-uritools-3.0.0/uritools/encoding.py --- python-uritools-2.2.0/uritools/encoding.py 2017-09-13 20:42:27.000000000 +0000 +++ python-uritools-3.0.0/uritools/encoding.py 2019-12-15 19:30:14.000000000 +0000 @@ -1,24 +1,7 @@ -from string import hexdigits +from string import hexdigits as _hex from .chars import UNRESERVED -if isinstance(chr(0), bytes): - _fromint = chr -else: - def _fromint(i): return bytes([i]) - -try: - _fromhex = bytes.fromhex -except AttributeError: - def _fromhex(x): return chr(int(x, 16)) - -try: - 0 in b'' -except TypeError: - def _tointseq(b): return memoryview(b).tolist() -else: - def _tointseq(b): return b - # RFC 3986 2.1: For consistency, URI producers and normalizers should # use uppercase hexadecimal digits for all percent-encodings. @@ -26,14 +9,14 @@ return ('%%%02X' % byte).encode() -_unreserved = frozenset(_tointseq(UNRESERVED.encode())) +_unreserved = frozenset(UNRESERVED.encode()) _encoded = { - b'': [_fromint(i) if i in _unreserved else _pctenc(i) for i in range(256)] + b'': [bytes([i]) if i in _unreserved else _pctenc(i) for i in range(256)] } _decoded = { - (a + b).encode(): _fromhex(a + b) for a in hexdigits for b in hexdigits + (a + b).encode(): bytes.fromhex(a + b) for a in _hex for b in _hex } @@ -47,10 +30,10 @@ encoded = _encoded[safe] except KeyError: encoded = _encoded[b''][:] - for i in _tointseq(safe): - encoded[i] = _fromint(i) + for i in safe: + encoded[i] = bytes([i]) _encoded[safe] = encoded - return b''.join(map(encoded.__getitem__, _tointseq(uristring))) + return b''.join(map(encoded.__getitem__, uristring)) def uridecode(uristring, encoding='utf-8', errors='strict'): diff -Nru python-uritools-2.2.0/uritools/__init__.py python-uritools-3.0.0/uritools/__init__.py --- python-uritools-2.2.0/uritools/__init__.py 2018-05-17 20:38:09.000000000 +0000 +++ python-uritools-3.0.0/uritools/__init__.py 2019-12-15 19:30:14.000000000 +0000 @@ -1,9 +1,8 @@ -"""RFC 3986 compliant, Unicode-aware, scheme-agnostic replacement for -urlparse. +"""RFC 3986 compliant, scheme-agnostic replacement for `urllib.parse`. This module defines RFC 3986 compliant replacements for the most -commonly used functions of the Python 2.7 Standard Library -:mod:`urlparse` module. +commonly used functions of the Python Standard Library +:mod:`urllib.parse` module. """ @@ -23,12 +22,12 @@ 'UNRESERVED', 'DefragResult', 'SplitResult', - 'isuri', + 'isabspath', 'isabsuri', 'isnetpath', - 'isabspath', 'isrelpath', 'issamedoc', + 'isuri', 'uricompose', 'uridecode', 'uridefrag', @@ -38,4 +37,4 @@ 'uriunsplit' ) -__version__ = '2.2.0' +__version__ = '3.0.0' diff -Nru python-uritools-2.2.0/uritools/split.py python-uritools-3.0.0/uritools/split.py --- python-uritools-2.2.0/uritools/split.py 2018-05-17 20:38:09.000000000 +0000 +++ python-uritools-3.0.0/uritools/split.py 2019-12-15 19:30:14.000000000 +0000 @@ -1,4 +1,5 @@ import collections +import collections.abc import ipaddress import re @@ -119,7 +120,7 @@ # TBD: (userinfo, host, port) kwargs, default string? if default is None: default = (None, None, None) - elif not isinstance(default, collections.Iterable): + elif not isinstance(default, collections.abc.Iterable): raise TypeError('Invalid default type') elif len(default) != 3: raise ValueError('Invalid default length') @@ -345,7 +346,7 @@ DIGITS = b'0123456789' -class SplitResultUnicode(SplitResult): +class SplitResultString(SplitResult): __slots__ = () # prevent creation of instance dictionary @@ -381,7 +382,7 @@ if isinstance(uristring, bytes): result = SplitResultBytes else: - result = SplitResultUnicode + result = SplitResultString return result(*result.RE.match(uristring).groups()) @@ -394,5 +395,5 @@ if isinstance(path, bytes): result = SplitResultBytes else: - result = SplitResultUnicode + result = SplitResultString return result(scheme, authority, path, query, fragment).geturi() diff -Nru python-uritools-2.2.0/uritools.egg-info/PKG-INFO python-uritools-3.0.0/uritools.egg-info/PKG-INFO --- python-uritools-2.2.0/uritools.egg-info/PKG-INFO 2018-05-17 20:39:18.000000000 +0000 +++ python-uritools-3.0.0/uritools.egg-info/PKG-INFO 2019-12-15 19:42:32.000000000 +0000 @@ -1,18 +1,37 @@ -Metadata-Version: 1.1 +Metadata-Version: 1.2 Name: uritools -Version: 2.2.0 -Summary: RFC 3986 compliant, Unicode-aware, scheme-agnostic replacement for urlparse +Version: 3.0.0 +Summary: URI parsing, classification and composition Home-page: https://github.com/tkem/uritools/ Author: Thomas Kemmer Author-email: tkemmer@computer.org License: MIT -Description-Content-Type: UNKNOWN Description: uritools ======================================================================== - 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. + .. image:: https://img.shields.io/pypi/v/uritools + :target: https://pypi.org/project/uritools + :alt: Latest PyPI version + + .. image:: https://img.shields.io/readthedocs/uritools + :target: https://uritools.readthedocs.io + :alt: Documentation build status + + .. image:: https://img.shields.io/travis/tkem/uritools + :target: https://travis-ci.org/tkem/uritools + :alt: Travis CI build status + + .. image:: https://img.shields.io/coveralls/tkem/uritools + :target: https://coveralls.io/r/tkem/uritools + :alt: Test coverage + + .. image:: https://img.shields.io/github/license/tkem/uritools + :target: http://raw.github.com/tkem/uritools/master/LICENSE + :alt: License + + This module provides RFC 3986 compliant functions for parsing, + classifying and composing URIs and URI references, largely replacing + the Python Standard Library's ``urllib.parse`` module. .. code-block:: pycon @@ -30,15 +49,17 @@ 8042 >>> parts.getquerydict().get('name') ['ferret'] + >>> parts.isuri() + True + >>> parts.isabsuri() + False >>> urijoin(uriunsplit(parts), '/right/here?name=swallow#beak') 'foo://example.com:8042/right/here?name=swallow#beak' - 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/parse.py - `_:: + For various reasons, ``urllib.parse`` and its Python 2 predecessor + ``urlparse`` are not compliant with current Internet standards. As + stated in `Lib/urllib/parse.py + `_: RFC 3986 is considered the current standard and any future changes to urlparse module should conform with it. The urlparse module is @@ -47,57 +68,44 @@ 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`` and - ``urllib.parse``, plus additional functions for conveniently composing - URIs from their individual components. + the most commonly used functions found in ``urllib.parse``. It also + includes functions for distinguishing between the different forms of + URIs and URI references, and for conveniently creating URIs from their + individual components. Installation ------------------------------------------------------------------------ - Install uritools using pip:: + uritools is available from PyPI_ and can be installed by running:: - pip install uritools + pip install uritools Project Resources ------------------------------------------------------------------------ - .. image:: http://img.shields.io/pypi/v/uritools.svg?style=flat - :target: https://pypi.python.org/pypi/uritools/ - :alt: Latest PyPI version - - .. image:: http://img.shields.io/travis/tkem/uritools/master.svg?style=flat - :target: https://travis-ci.org/tkem/uritools/ - :alt: Travis CI build status - - .. image:: http://img.shields.io/coveralls/tkem/uritools/master.svg?style=flat - :target: https://coveralls.io/r/tkem/uritools - :alt: Test coverage - - .. image:: https://readthedocs.org/projects/uritools/badge/?version=latest&style=flat - :target: http://uritools.readthedocs.io/en/latest/ - :alt: Documentation Status - - - `Issue Tracker`_ - - `Source Code`_ - - `Change Log`_ + - `Documentation`_ + - `Issue tracker`_ + - `Source code`_ + - `Change log`_ License ------------------------------------------------------------------------ - Copyright (c) 2014-2018 Thomas Kemmer. + Copyright (c) 2014-2019 Thomas Kemmer. Licensed under the `MIT License`_. - .. _Issue Tracker: https://github.com/tkem/uritools/issues/ - .. _Source Code: https://github.com/tkem/uritools/ - .. _Change Log: https://github.com/tkem/uritools/blob/master/CHANGES.rst + .. _PyPI: https://pypi.org/project/uritools/ + .. _Documentation: https://uritools.readthedocs.io/ + .. _Issue tracker: https://github.com/tkem/uritools/issues/ + .. _Source code: https://github.com/tkem/uritools/ + .. _Change log: https://github.com/tkem/uritools/blob/master/CHANGELOG.rst .. _MIT License: http://raw.github.com/tkem/uritools/master/LICENSE -Keywords: uri url urlparse urlsplit urljoin urldefrag Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Other Environment @@ -105,12 +113,10 @@ Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 -Classifier: Topic :: Internet +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Topic :: Software Development :: Libraries :: Python Modules +Requires-Python: ~=3.5 diff -Nru python-uritools-2.2.0/uritools.egg-info/requires.txt python-uritools-3.0.0/uritools.egg-info/requires.txt --- python-uritools-2.2.0/uritools.egg-info/requires.txt 2018-05-17 20:39:18.000000000 +0000 +++ python-uritools-3.0.0/uritools.egg-info/requires.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ - -[:python_version == "2.7"] -ipaddress diff -Nru python-uritools-2.2.0/uritools.egg-info/SOURCES.txt python-uritools-3.0.0/uritools.egg-info/SOURCES.txt --- python-uritools-2.2.0/uritools.egg-info/SOURCES.txt 2018-05-17 20:39:18.000000000 +0000 +++ python-uritools-3.0.0/uritools.egg-info/SOURCES.txt 2019-12-15 19:42:32.000000000 +0000 @@ -1,4 +1,4 @@ -CHANGES.rst +CHANGELOG.rst LICENSE MANIFEST.in README.rst @@ -28,5 +28,4 @@ uritools.egg-info/PKG-INFO uritools.egg-info/SOURCES.txt uritools.egg-info/dependency_links.txt -uritools.egg-info/requires.txt uritools.egg-info/top_level.txt \ No newline at end of file