Skip to main content

Nice URLs for Python

Project description

Sometimes it feels like working with URLs is harder than it should be. Urly is a little wrapper around the werkzeug URL class to make things easy and pleasant. One module to pip install, one import, and then everything is easy. For instance:

>>> from urly import URL
>>> url = URL('http://example.com/old/path?a=b')
>>> url.path = '/new/path'
>>> url.add_param('a', 'c')
>>> print(url)
http://example.com/new/path?a=b&a=c
>>> print(url.relative_url)
/new/path?a=b&a=c

Common tasks like changing a path, adding a parameter, and getting the relative URL, are all simple.

Urly also lets you parse URLs the way a browser would. For instance:

>>> url = URL('example.com', parse_like_browser=True)
>>> print(url)
http://example.com

Documentation

Full documentation is at https://urly.readthedocs.org.

Install

Simply install with pip:

$ pip install urly

Project details


Download files

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

Source Distribution

urly-0.1.1455780396.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

urly-0.1.1455780396-py2.py3-none-any.whl (5.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file urly-0.1.1455780396.tar.gz.

File metadata

File hashes

Hashes for urly-0.1.1455780396.tar.gz
Algorithm Hash digest
SHA256 a62c31b58c26c2ea0689e6d4be5347ef6e8771e34ad41f4af186320587e7fc84
MD5 e30ac65cb53fc7b498e7eb1d5dfece0a
BLAKE2b-256 9382bb3bfdf18a0f860dfed92b7a78455544a42cc45ea228f72042ce012f4c11

See more details on using hashes here.

File details

Details for the file urly-0.1.1455780396-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for urly-0.1.1455780396-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a2e68e6ab208bb764162cc556825f5c82c2e248682d19f3659abde5e08773a1e
MD5 c667338e98a2df1dead77ba51d60d9d1
BLAKE2b-256 27efe339439fea2e86275cf66746580a9f614b1419d9d32195c11f06aa6ea081

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page