urp is a command-line tool for building URLs, and for extracting and modifying their features. It knows all about schemes, authentication, hosts, ports, paths, parameters, query strings, and fragments.
urp is distributed through PyPI. You can always get the latest with pip:
$ pip install urp
Add to the path of a URL:
$ urp -D bar http://domain.com/foo?baz=bux
http://domain.com/foo/bar?baz=bux
Extract a value from a query parameter:
$ urp -g q http://domain.com/search?q=urp%20is%20dope
urp is dope
Add authorization to a protected resource:
$ urp -U foo -W password http://protected.com
http://foo:password@protected.com
Sign a request with an MD5 hex digest:
$ url="http://api.com/resource?param=bux&app_id=foo"
$ urp $url -Q signature=$(urp $url --sort-query -q | md5)
http://api.com/resource?param=bux&app_id=foo&signature=f2d434f97779e6a31dbaf606b43064a5
urp is documented in its manual page.
Development happens on the GitHub project page.
Copyright © 2014 Justin Poliey