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

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

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