{"id":15395446,"url":"https://github.com/stef/urlclean","last_synced_at":"2025-04-16T00:11:43.560Z","repository":{"id":2293947,"uuid":"3252138","full_name":"stef/urlclean","owner":"stef","description":"module that resolves and cleans up urls","archived":false,"fork":false,"pushed_at":"2021-07-20T22:10:45.000Z","size":27,"stargazers_count":22,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-16T00:11:27.276Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://pypi.python.org/pypi/urlclean/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stef.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-01-24T01:12:51.000Z","updated_at":"2023-12-11T22:08:06.000Z","dependencies_parsed_at":"2022-07-13T12:40:53.429Z","dependency_job_id":null,"html_url":"https://github.com/stef/urlclean","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stef%2Furlclean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stef%2Furlclean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stef%2Furlclean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stef%2Furlclean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stef","download_url":"https://codeload.github.com/stef/urlclean/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249173084,"owners_count":21224483,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T15:28:23.531Z","updated_at":"2025-04-16T00:11:43.546Z","avatar_url":"https://github.com/stef.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nWelcome to urlclean's documentation!\n************************************\n\nurlclean provides functions:\n\n* to follow a http redirect,\n\n* to follow a HTML META redirect,\n\n* to remove Urchin and Facebook tracker URL parameters,\n\n* plugins for futher cleaning power,\n\n* combines all these to unshorten and resolve various URLS\n\nTry it out from the commandline:\n\n   python -m urlclean \u003csome url\u003e\n\n\nDocumentation\n=============\n\nurlcleaner a module that resolves redirected urls and removes tracking\nurl params\n\nurlclean.weedparams(url)\n\n   removes Urchin Tracker and Facebook surveillance params from urls.\n\n   Args:\n\n      url (str):  The url to scrub\n\n   Returns:\n\n      (str).  The return cleaned url\n\nurlclean.httpresolve(url, ua=None, proxyhost='', proxyport='')\n\n   resolve one redirection of a http request.\n\n   Args:\n\n      url (str):  The url to follow one redirect\n\n      ua (fn):  A function returning a User Agent string (optional)\n\n      proxyhost (str):  http proxy server (optional)\n\n      proxyport (int):  http proxy server port (optional)\n\n   Returns: (str, http.client.response).  The return resolved url, and\n      the response from the http query\n\nurlclean.unmeta(url, res)\n\n   Finds any meta redirects a http.client.response object that has\n   text/html as content-type.\n\n   Args:\n\n      url (str):  The url to follow one redirect\n\n      res (http.client.response):  a http response object\n\n   Returns: (str).  The return resolved url\n\nurlclean.unshorten(url, cache=None, ua=None, \u003e\u003e**\u003c\u003ckwargs)\n\n   resolves all HTTP/META redirects and optionally caches them in any\n   object supporting a __getitem__, __setitem__ interface\n\n   Args:\n\n      url (str):  The url to follow one redirect\n\n      cache (PersistentCryptoDict):  an optional PersistentCryptoDict\n      instance\n\n      ua (fn):  A function returning a User Agent string (optional),\n      the default is googlebot.\n\n      \u003e\u003e**\u003c\u003ckwargs (dict):  optional proxy args for\n      urlclean.httpresolve (default: localhost:8118)\n\n   Returns: (str).  The return final cleaned url.\n\n\nPlugins\n=======\n\nPlugins should have a convert function that receives and returns a\nURL. In case of an error an unchanged URL should be returned.\n\n\nChangelog\n=========\n\n* v0.6.0 - migrated to python 3\n\n* v0.5.4 - fixed httpresolve for relative urls\n\n* v0.5.1 - install/doc fixes\n\n* v0.5 - added plugins\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstef%2Furlclean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstef%2Furlclean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstef%2Furlclean/lists"}