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)
| 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 |