Skip to main content

urlnorm.py

Normalize a URL to a standard unicode representation

urlnorm normalizes a URL by:

  • lowercasing the scheme and hostname

  • converting the hostname to IDN format

  • taking out default port if present (e.g., http://www.foo.com:80/)

  • collapsing the path (./, ../, etc)

  • removing the last character in the hostname if it is ‘.’

  • unquoting any % escaped characters (where possible)

Installation

pip install urlnorm

Example

>>> import urlnorm
>>> urlnorm.norm("http://xn--q-bga.com./u/u/../%72/l/")
u'http://q\xe9.com/u/r/l/'

Release files for urlnorm 1.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for urlnorm 1.1.4
File Size Uploaded
urlnorm-1.1.4.tar.gz 4.3 kB Details

Release files / urlnorm-1.1.4.tar.gz

Download URL urlnorm-1.1.4.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3cde99b7ec8edb6768dfecbed5d97e9bd0c784b0593ee28a3f83b20419dcd75e
BLAKE2b-256 checksum
How to use checksums
4d462bbc8d92698b72c44099e215cdaff85a7c27c64fbcf74aa8e313a4da36fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.1.4 This release

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1

1 release file

1.0.1

1 release file

1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page