hyperlink
17.3
  • Hyperlink Design
    • A Tale of Two Representations
    • Immutability
    • Query parameters
    • Origins and backwards-compatibility
  • Hyperlink API
    • Creation
    • Transformation
    • Navigation
    • Query Parameters
    • Attributes
    • Low-level functions
  • FAQ
    • Why not just use text?
    • How does Hyperlink compare to other libraries?
    • Are URLs really a big deal in 201X?
hyperlink
  • Docs »
  • hyperlink
  • View page source

hyperlink¶

Cool URLs that don’t change.

release calver

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 URIs and IRIs.

Hyperlink is tested against Python 2.7, 3.4, 3.5, 3.6, 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:

from hyperlink import URL

url = URL.from_text('http://github.com/python-hyper/hyperlink?utm_souce=readthedocs')

better_url = url.replace(scheme='https')
user_url = better_url.click('..')

print(user_url.to_text())
# prints: https://github.com/mahmoud

print(user_url.get('utm_source'))
# prints: readthedocs

See the API docs for more usage examples.

Gaps¶

Found something missing in hyperlink? Pull Requests and Issues weclome!

Section listing¶

  • Hyperlink Design
    • A Tale of Two Representations
    • Immutability
    • Query parameters
    • Origins and backwards-compatibility
  • Hyperlink API
    • Creation
    • Transformation
    • Navigation
    • Query Parameters
    • Attributes
    • Low-level functions
  • FAQ
    • Why not just use text?
    • How does Hyperlink compare to other libraries?
    • Are URLs really a big deal in 201X?
Next

© Copyright 2017, Mahmoud Hashemi

Built with Sphinx using a theme provided by Read the Docs.