Skip to main content

murl is a tiny wrapper for the Python module urlparse.

Project description

murl: URL manipulation in Python, made simple
=============================================

.. image:: https://secure.travis-ci.org/berkerpeksag/murl.png
:alt: Travis CI
:target: http://travis-ci.org/berkerpeksag/murl

murl is a tiny wrapper for the Python module `urlparse <http://docs.python.org/library/urlparse.html>`_.

Installation
------------

To install murl, simply::

$ pip install murl

Usage
-----

::

from murl import Url


url = Url('https://bugzilla.mozilla.org/show_bug.cgi?id=698201#c0')
print url.scheme, url.host, url.querystring, url.fragment
# https bugzilla.mozilla.org id=698201 c0

url.scheme = 'http'
url.host = 'bugzilla.webkit.org'

print url
print url.url
print url.scheme
print url.host
print url.netloc
print url.host == url.netloc
# http://bugzilla.webkit.org/show_bug.cgi?id=698201#c0
# http://bugzilla.webkit.org/show_bug.cgi?id=698201#c0
# http
# bugzilla.webkit.org
# bugzilla.webkit.org
# True

url.path = 'list_bugs.cgi'
print url.path, url.url
# list_bugs.cgi http://bugzilla.webkit.org/list_bugs.cgi?id=698201#c0

url.fragment = 'c1'
print url.fragment
print url.url
# c1
# http://bugzilla.webkit.org/list_bugs.cgi?id=698201#c1

url.fragment = ''
print url.fragment
print url.url
# ''
# http://bugzilla.webkit.org/list_bugs.cgi?id=698201

License
-------

All files that are part of this project are covered by the following license, except where explicitly noted.

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.

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

murl-0.2.tar.gz (3.2 kB view details)

Uploaded Source

File details

Details for the file murl-0.2.tar.gz.

File metadata

  • Download URL: murl-0.2.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for murl-0.2.tar.gz
Algorithm Hash digest
SHA256 7c97a267a0c8454c1cb57ece35e33f1b2a868cac2fb16b8fb7f48ddc65c67e40
MD5 3bacc6fb779841d1aa6ce78ed549367a
BLAKE2b-256 58993d11322fd3a81a36d228976e7a7ae4391d31c1f9afd82bde762605711fc1

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