2017-03-25 03:22:10 +02:00
|
|
|
# Hyperlink
|
|
|
|
|
|
|
|
*Cool URLs that don't change.*
|
|
|
|
|
2017-04-22 11:12:58 +03:00
|
|
|
<a href="https://hyperlink.readthedocs.io/en/latest/"><img src="https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat"></a>
|
|
|
|
<a href="https://pypi.python.org/pypi/hyperlink"><img src="https://img.shields.io/pypi/v/boltons.svg"></a>
|
|
|
|
<a href="http://calver.org"><img src="https://img.shields.io/badge/calver-YY.MINOR.MICRO-22bfda.svg"></a>
|
|
|
|
|
2017-03-25 03:22:10 +02:00
|
|
|
Hyperlink provides a pure-Python implementation of immutable
|
2017-07-08 15:49:54 +03:00
|
|
|
URLs. Based on [RFC 3986][rfc3986] and [3987][rfc3987], the Hyperlink URL
|
|
|
|
makes working with both URIs and IRIs easy.
|
2017-03-25 03:22:10 +02:00
|
|
|
|
2017-07-08 15:49:54 +03:00
|
|
|
Hyperlink is tested against Python 2.7, 3.4, 3.5, 3.6, and PyPy.
|
2017-03-25 03:22:10 +02:00
|
|
|
|
2017-07-08 15:49:54 +03:00
|
|
|
Full documentation is available on [Read the Docs][docs].
|
|
|
|
|
|
|
|
[rfc3986]: https://tools.ietf.org/html/rfc3986
|
|
|
|
[rfc3987]: https://tools.ietf.org/html/rfc3987
|
|
|
|
[docs]: http://hyperlink.readthedocs.io/en/latest/
|
2017-03-25 03:22:10 +02:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
Hyperlink is a pure-Python package and requires nothing but
|
|
|
|
Python. The easiest way to install is with pip:
|
|
|
|
|
|
|
|
```
|
2017-07-08 15:49:54 +03:00
|
|
|
pip install hyperlink
|
2017-03-25 03:22:10 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
Then, hyperlink away!
|
|
|
|
|
|
|
|
```python
|
2017-07-08 15:49:54 +03:00
|
|
|
from hyperlink import URL
|
2017-03-25 03:22:10 +02:00
|
|
|
|
2017-07-08 15:49:54 +03:00
|
|
|
url = URL.from_text('http://github.com/mahmoud/hyperlink?utm_source=README')
|
|
|
|
utm_source = url.get('utm_source')
|
|
|
|
better_url = url.replace(scheme='https')
|
|
|
|
user_url = better_url.click('..')
|
2017-03-25 03:22:10 +02:00
|
|
|
```
|
|
|
|
|
2017-07-08 15:49:54 +03:00
|
|
|
See the full API docs on [Read the Docs][docs].
|
2017-03-25 03:22:10 +02:00
|
|
|
|
|
|
|
## More information
|
|
|
|
|
|
|
|
Hyperlink would not have been possible without the help of
|
2017-06-02 12:41:43 +03:00
|
|
|
[Glyph Lefkowitz](https://glyph.twistedmatrix.com/) and many other
|
|
|
|
community members, especially considering that it started as an
|
|
|
|
extract from the Twisted networking library. Thanks to them,
|
|
|
|
Hyperlink's URL has been production-grade for well over a decade.
|
2017-03-25 03:22:10 +02:00
|
|
|
|
|
|
|
Still, should you encounter any issues, do file an issue, or submit a
|
|
|
|
pull request.
|