Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Resolve complete/partial URLs against a canonical target URL

Project Description

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).

# 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.

Getting Started

Install the module with: pip install resolve_link

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.

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.

Release History

Release History

This version
History Node

1.2.0

History Node

1.1.0

History Node

1.0.1

History Node

1.0.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
resolve_link-1.2.0.tar.gz (6.8 kB) Copy SHA256 Checksum SHA256 Source Jul 8, 2015
resolve_link-1.2.0.zip (12.7 kB) Copy SHA256 Checksum SHA256 Source Jul 8, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting