Skip to main content

convenience functions for working with URLs

Project description

URL related utility functions and classes.

Latest release 20231129:

  • Drop Python 2 support.
  • No longer use cs.xml, which is going away.
  • Make _URL type public as URL with a new promote() method, drop URL factory function, update URL constructors throughout.
  • URL.init: make parameters keyword only.

Class NetrcHTTPPasswordMgr(urllib.request.HTTPPasswordMgrWithDefaultRealm, urllib.request.HTTPPasswordMgr)

A subclass of HTTPPasswordMgrWithDefaultRealm that consults the .netrc file if no overriding credentials have been stored.

Function skip_errs(iterable)

Iterate over iterable and yield its values. If it raises URLError or HTTPError, report the error and skip the result.

Function strip_whitespace(s)

Strip whitespace characters from a string, per HTML 4.01 section 1.6 and appendix E.

Class URL(builtins.str, cs.deco.Promotable)

Utility class to do simple stuff to URLs, subclasses str.

Release Log

Release 20231129:

  • Drop Python 2 support.
  • No longer use cs.xml, which is going away.
  • Make _URL type public as URL with a new promote() method, drop URL factory function, update URL constructors throughout.
  • URL.init: make parameters keyword only.

Release 20191004: Small updates for changes to other modules.

Release 20160828: Use "install_requires" instead of "requires" in DISTINFO.

Release 20160827:

  • Handle TimeoutError, reporting elapsed time.
  • URL: present ._fetch as .GET.
  • URL: add .resolve to resolve this URL against a base URL.
  • URL: add .savepath and .unsavepath methods to generate nonconflicting save pathnames for URLs and the reverse.
  • URL._fetch: record the post-redirection URL as final_url.
  • New URLLimit class for specifying simple tests for URL acceptance.
  • New walk(): method to walk website from starting URL, yielding URLs.
  • URL.content_length property, returns int or None if header missing.
  • New URL.normalised method to return URL with . and .. processed in the path.
  • new URL.exists test function.
  • Assorted bugfixes and improvements.

Release 20150116: Initial PyPI release.

Project details


Download files

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

Source Distribution

cs.urlutils-20231129.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cs.urlutils-20231129-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file cs.urlutils-20231129.tar.gz.

File metadata

  • Download URL: cs.urlutils-20231129.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for cs.urlutils-20231129.tar.gz
Algorithm Hash digest
SHA256 be83b55f9cedab0d9a052029c2b6e148b2c685ac21670fe0a6d9f4dc17ddc36f
MD5 d8d60af07643d3591ec4c2bc796463b0
BLAKE2b-256 119912d87a09ddd967636c81d9bedbaac5c923cc399d8ab83c061c08d3fc8f42

See more details on using hashes here.

File details

Details for the file cs.urlutils-20231129-py3-none-any.whl.

File metadata

  • Download URL: cs.urlutils-20231129-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for cs.urlutils-20231129-py3-none-any.whl
Algorithm Hash digest
SHA256 7ed0c547a7e4b42887a7e33d8dd134a9032897d26999594e5c3d9c6a6772354f
MD5 8345e6de2c33ec921e64e6b2bcf41e8e
BLAKE2b-256 1bef9d2095b4542ba3b8f8cd4b29d2ddcc694e2bf6ee5b442761cc91cc7abf8c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page