Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install urlclean

How to install urlclean

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install urlclean
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.5.4Never BuiltWhy not?
0.5.1 Failed View build log
0.4.3 Failed View build log
0.4.2 Failed View build log
0.4.1 Failed View build log
Windows (64-bit)
0.5.4Never BuiltWhy not?
0.5.1 Failed View build log
0.4.3 Failed View build log
0.4.2 Failed View build log
0.4.1 Failed View build log
Mac OS X (10.5+)
0.5.4 Available View build log
0.5.1 Failed View build log
0.4.3 Failed View build log
0.4.2 Failed View build log
0.4.1 Failed View build log
Linux (32-bit)
0.5.4 Available View build log
0.5.1 Failed View build log
0.4.3 Failed View build log
0.4.2 Failed View build log
0.4.1 Failed View build log
Linux (64-bit)
0.5.4 Available View build log
0.5.1 Failed View build log
0.4.3 Failed View build log
0.4.2 Failed View build log
0.4.1 Failed View build log
 
License
AGPLv3+
Dependencies
Imports
Lastest release
version 0.5.4 on Jul 23rd, 2013

Welcome to urlclean's documentation!

urlclean provides functions:

  • to follow a http redirect,
  • to follow a HTML META redirect,
  • to remove Urchin and Facebook tracker URL parameters,
  • plugins for futher cleaning power,
  • combines all these to unshorten and resolve various URLS

Try it out from the commandline:

python -m urlclean <some url>

Contents:

Indices and tables

  • Index
  • Module Index
  • Search Page
Documentation for the Code

urlcleaner a module that resolves redirected urls and removes tracking url params

urlclean.weedparams(url)

removes Urchin Tracker and Facebook surveillance params from urls.

Args:

url (str): The url to scrub of ugly params

Returns:

(str). The return cleaned url

urlclean.httpresolve(url, ua=None, proxyhost='', proxyport='')

resolve one redirection of a http request.

Args:

url (str): The url to follow one redirect

ua (fn): A function returning a User Agent string (optional)

proxyhost (str): http proxy server (optional)

proxyport (int): http proxy server port (optional)

Returns: (str, httplib.response). The return resolved url, and
the response from the http query

urlclean.unmeta(url, res)

Finds any meta redirects a httplib.response object that has text/html as content-type.

Args:

url (str): The url to follow one redirect

res (httplib.response): a http.response object

Returns: (str). The return resolved url

urlclean.unshorten(url, cache=None, ua=None, >>**<<kwargs)

resolves all HTTP/META redirects and optionally caches them in any object supporting a __getitem__, __setitem__ interface

Args:

url (str): The url to follow one redirect

cache (PersistentCryptoDict): an optional PersistentCryptoDict instance

ua (fn): A function returning a User Agent string (optional), the default is googlebot.

>>**<<kwargs (dict): optional proxy args for urlclean.httpresolve (default: localhost:8118)

Returns: (str). The return final cleaned url.

Plugins

Plugins should have a convert function that receives and returns a URL. In case of an error an unchanged URL should be returned.

Changelog
  • v0.5.4 - fixed httpresolve for relative urls
  • v0.5.1 - install/doc fixes
  • v0.5 - added plugins

Subscribe to package updates

Last updated Jul 23rd, 2013

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.