Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A simple url parsing library for python

Project Description

P.url is a simple url parsing library for python. Currently, you can modify querystrings for given urls by adding or deleting. Chaining is supported!


Add/update query

from purl import Purl

url = Purl('')

str(url.add_query('q', 'dog')) # => ''
url = Purl('')

  'q': 'cat',
  'l': 'JavaScript',
  'type': 'Issues'

# or

url = Purl('')

str(url.add_query('q', 'cat')
  .add_query('l', 'JavaScript')
  .add_query('type', 'Issues')) # => ''

Delete query

from purl import Purl

url = Purl('')

str(url.delete_query('q')) # => ''
url = Purl('')

str(url.delete_query(['q', 'type'])) # =>

# or

url = Purl('')
  .delete_query('type')) # => ''


url = ( Purl('')
  .param('resource', 'user').param('id', 12).param('action', 'favorites')

# or

url = ( Purl('')
    'resource': 'user',
    'id': 12,
    'action': 'favorites'
str(url) # => ''

Running the tests

make sure you have py test installed

pip install pytest

Then run:


Release History

This version
History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(4.9 kB) Copy SHA256 Hash SHA256
Source None Feb 23, 2016

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Google Google Cloud Servers Fastly Fastly CDN StatusPage StatusPage Statuspage DigiCert DigiCert EV Certificate