# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= python-url-normalize VERSION= 2.2.1 KEYWORDS= python VARIANTS= v12 v13 SDESC[v12]= URL normalization for Python (3.12) SDESC[v13]= URL normalization for Python (3.13) HOMEPAGE= https://github.com/niksite/url-normalize CONTACT= Python_Automaton[python@ironwolf.systems] DOWNLOAD_GROUPS= main SITES[main]= PYPIWHL/bc/d9/5ec15501b675f7bc07c5d16aa70d8d778b12375686b6efd47656efdc67cd DISTFILE[1]= url_normalize-2.2.1-py3-none-any.whl:main DIST_SUBDIR= python-src DF_INDEX= 1 SPKGS[v12]= single SPKGS[v13]= single OPTIONS_AVAILABLE= PY312 PY313 OPTIONS_STANDARD= none VOPTS[v12]= PY312=ON PY313=OFF VOPTS[v13]= PY312=OFF PY313=ON DISTNAME= url_normalize-2.2.1.dist-info GENERATED= yes [PY312].RUN_DEPENDS_ON= python-idna:single:v12 [PY312].USES_ON= python:v12,wheel [PY313].RUN_DEPENDS_ON= python-idna:single:v13 [PY313].USES_ON= python:v13,wheel [FILE:2650:descriptions/desc.single] # url-normalize [tests] [Coveralls] [PyPI] A Python library for standardizing and normalizing URLs with support for internationalized domain names (IDN). ## Table of Contents - [Introduction] - [Features] - [Installation] - [Usage] - [Python API] - [Command Line] - [Documentation] - [Contributing] - [License] ## Introduction url-normalize provides a robust URI normalization function that: - Takes care of IDN domains. - Always provides the URI scheme in lowercase characters. - Always provides the host, if any, in lowercase characters. - Only performs percent-encoding where it is essential. - Always uses uppercase A-through-F characters when percent-encoding. - Prevents dot-segments appearing in non-relative URI paths. - For schemes that define a default authority, uses an empty authority if the default is desired. - For schemes that define an empty path to be equivalent to a path of "/", uses "/". - For schemes that define a port, uses an empty port if the default is desired - Ensures all portions of the URI are utf-8 encoded NFC from Unicode strings Inspired by Sam Ruby's [urlnorm.py] ## Features - **IDN Support**: Full internationalized domain name handling - **Configurable Defaults**: - Customizable default scheme (https by default) - Configurable default domain for absolute paths - **Query Parameter Control**: - Parameter filtering with allowlists - Support for domain-specific parameter rules - **Versatile URL Handling**: - Empty string URLs - Double slash URLs (//domain.tld) - Shebang (#!) URLs - **Developer Friendly**: - Cross-version Python compatibility (3.8+) - 100% test coverage - Modern type hints and string handling ## Installation ```sh pip install url-normalize ``` ## Usage ### Python API ```python from url_normalize import url_normalize # Basic normalization (uses https by default) print(url_normalize("www.foo.com:80/foo")) # Output: https://www.foo.com/foo # With custom default scheme print(url_normalize("www.foo.com/foo", default_scheme="http")) # Output: http://www.foo.com/foo # With query parameter filtering enabled print(url_normalize("www.google.com/search?q=test&utm_source=test", filter_params=True)) # Output: https://www.google.com/search?q=test # With custom parameter allowlist as a dict print(url_normalize( "example.com?page=1&id=123&ref=test", filter_params=True, param_allowlist={"example.com": ["page", "id"]} )) # Output: https://example.com?page=1&id=123 # With custom parameter allowlist as a list print(url_normalize( "example.com?page=1&id=123&ref=test", filter_params=True, param_allowlist=["page", "id"] [FILE:126:distinfo] 3deb687587dc91f7b25c9ae5162ffc0f057ae85d22b1e15cf5698311247f567b 14728 python-src/url_normalize-2.2.1-py3-none-any.whl