Metadata-Version: 1.1
Name: resolve_link
Version: 1.0.0
Summary: Resolve complete/partial URLs against a canonical target URL
Home-page: https://github.com/underdogio/python-resolve-link
Author: Todd Wolfson
Author-email: todd@twolfson.com
License: MIT
Download-URL: https://github.com/underdogio/python-resolve-link/archive/master.zip
Description: resolve-link
        ============
        
        .. image:: https://travis-ci.org/twolfson/resolve-link.png?branch=master
           :target: https://travis-ci.org/twolfson/resolve-link
           :alt: Build Status
        
        Resolve complete/partial URLs against a canonical target URL
        
        This library was built to resolve URLs when candidates submit incompleted URLs (e.g. missing protocol, username only).
        
        .. code:: python
        
            # Username only
            resolve_link('underdogio', 'https://github.com/')
                # https://github.com/underdogio
        
            # Missing protocol
            resolve_link('www.linkedin.com/in/toddwolfson', 'https://www.linkedin.com/')
                # https://www.linkedin.com/in/toddwolfson
        
            # Custom website
            resolve_link('https://underdog.io/', 'https://www.linkedin.com/')
                # https://underdog.io/
        
            # Complete URL
            resolve_link('https://github.com/underdogio', 'https://github.com/')
                # https://github.com/underdogio
        
        This is a port of our JavaScript library `resolve-link`_.
        
        .. _`resolve-link`: http://github.com/underdogio/resolve-link
        
        Getting Started
        ---------------
        Install the module with: ``pip install resolve_link``
        
        .. code:: python
        
            from resolve_link import resolve_link
            resolve_link('underdogio', 'https://github.com/')  # https://github.com/underdogio
        
        Documentation
        -------------
        We expose ``resolve_link`` via our package ``resolve_link``.
        
        resolve_link(src_url, target_url)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        Resolve the best variation of ``src_url`` with respect to our ``target_url``
        
        - src_url ``str`` - URL/partial URL to be resolving from
        - target_url ``str`` - Canonical URL to try to match if on the same domain
        
        **Returns:**
        
        - ret_val ``str`` - Completed URL formatted via ``urllib.parse``
        
        Contributing
        ------------
        In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Test via ``nosetests``.
        
        License
        -------
        Copyright (c) 2015 Underdog.io
        
        Licensed under the MIT license.
        
Keywords: resolve,link,url,target,canonical
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Internet :: WWW/HTTP
