Skip to content

Latest commit

 

History

History
73 lines (49 loc) · 2.17 KB

index.rst

File metadata and controls

73 lines (49 loc) · 2.17 KB

hyperlink

Cool URLs that don't change.

release calver changelog

Hyperlink provides a pure-Python implementation of immutable URLs. Based on RFC 3986 and RFC 3987, the Hyperlink URL balances simplicity and correctness for both :ref:`URIs and IRIs <uris_and_iris>`.

Hyperlink is tested against Python 2.7, 3.4, 3.5, 3.6, 3.7, 3.8, and PyPy.

For an introduction to the hyperlink library, its background, and URLs in general, see this talk from PyConWeb 2017 (and the accompanying slides).

Installation and Integration

Hyperlink is a pure-Python package and only depends on the standard library. The easiest way to install is with pip:

pip install hyperlink

Then, URLs are just an import away:

import hyperlink

url = hyperlink.parse(u'http://github.com/python-hyper/hyperlink?utm_source=readthedocs')

better_url = url.replace(scheme=u'https', port=443)
org_url = better_url.click(u'.')

print(org_url.to_text())
# prints: https://github.com/python-hyper/

print(better_url.get(u'utm_source')[0])
# prints: readthedocs

See :ref:`the API docs <hyperlink_api>` for more usage examples.

Gaps

Found something missing in hyperlink? Pull Requests and Issues are welcome!

Table of Contents

.. toctree::
   :maxdepth: 2

   design
   api
   faq