This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
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!

Usage

Add/update query

from purl import Purl

url = Purl('https://github.com/search?q=cat')

str(url.add_query('q', 'dog')) # => 'https://github.com/search?q=dog'
url = Purl('https://github.com/search')

str(url.add_query({
  'q': 'cat',
  'l': 'JavaScript',
  'type': 'Issues'
}))

# or

url = Purl('https://github.com/search')

str(url.add_query('q', 'cat')
  .add_query('l', 'JavaScript')
  .add_query('type', 'Issues')) # => 'https://github.com/search?l=JavaScript&q=cat&type=Issues'

Delete query

from purl import Purl

url = Purl('https://github.com/search?q=cat')

str(url.delete_query('q')) # => 'https://github.com/search'
url = Purl('https://github.com/search?l=JavaScript&q=cat&type=Issues')

str(url.delete_query(['q', 'type'])) # => https://github.com/search?l=JavaScript

# or

url = Purl('https://github.com/search?l=JavaScript&q=cat&type=Issues')
str(url.delete_query('q')
  .delete_query('type')) # => 'https://github.com/search?l=JavaScript'

Params

url = ( Purl('https://some.public.api.com')
  .path('/:resource/:id/:action')
  .param('resource', 'user').param('id', 12).param('action', 'favorites')
)
str(url)

# or

url = ( Purl('https://some.public.api.com')
  .path('/:resource/:id/:action')
  .param({
    'resource': 'user',
    'id': 12,
    'action': 'favorites'
  })
)
str(url) # => 'https://some.public.api.com/user/12/favorites'

Running the tests

make sure you have py test installed

pip install pytest

Then run:

py.test

Release History

Release History

0.1.0a4

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
p.url-0.1.0a4.tar.gz (4.9 kB) Copy SHA256 Checksum SHA256 Source Feb 23, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting