urlcanon
url canonicalization library for python and java
What it is and what it does
urlcanon is a URL parser and normalizer that implements the WHATWG URL standard used by web browsers. It parses URLs while preserving the original input bytes, then applies a canonicalization ruleset to normalize them into a standard form—lowercasing domains, removing default ports, resolving path segments, and collapsing redundant slashes. It also provides SSURT, an alternative serialization format designed for efficient sorting and prefix-matching of URLs.
The library is stable and has been in production use, but the project is no longer actively maintained. It offers a Python API (and a separate Java implementation). The package has no runtime dependencies, making it lightweight to install, but it is distributed only as source code, requiring compilation on install.
Use it for:
- Normalize URLs in web crawlers or archival systems to deduplicate and match equivalent URLs despite surface differences.
- Implement URL-based filtering rules by converting URLs to SSURT format for efficient prefix-matching and sorting.
- Parse and standardize URLs in data pipelines where browser-compatible normalization is required.
- Build URL deduplication logic in search indexers or link analysis tools.
- Validate and canonicalize user-supplied URLs before storage or comparison.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses and normalizes URLs according to WHATWG browser standards, with optional SSURT serialization for sorting and prefix-matching.
No. The package is abandoned (last release 2019-07-02, no commits since 2022-05-22) and classifiers indicate support only through Python 3.7, with no verification of compatibility with later versions. The source-only distribution adds install friction. Unless you are maintaining legacy code already using urlcanon, consider a maintained alternative for new projects.
Install
urlcanon on PyPI
pip
pip install urlcanonuv
uv add urlcanonpoetry
poetry add urlcanonInstalling urlcanon
Before you install
High install friction: the package is distributed as a source tarball with no prebuilt wheels. Maintenance is abandoned—last release was 2019-07-02, last commit 2022-05-22, and no updates in approximately 2600 days. Classifiers list Python 2.7 through 3.7.
License in practice
Licensed under Apache License 2.0 (permissive). You may use, modify, and distribute the software freely provided you include the license notice and disclaimer.
Quickstart
pip install urlcanon
import urlcanon
parsed_url = urlcanon.parse_url("http://EXAMPLE.com:80/foo/../bar")
urlcanon.whatwg(parsed_url)
print(parsed_url)
Source-only distribution (no wheels); requires a C compiler and build tools. Classifiers indicate Python 2.7–3.7 support; compatibility with later versions is unverified.
Verify before relying
- Whether the package builds and runs on Python versions after 3.7.
- Whether the package has any undiscovered security issues or breaking changes since its last release in 2019.
Package facts
| License | not declared (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,600 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 147,557/month — #11,060 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: urlcanon-0.3.1.tar.gz
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
ada-urlParse, validate, and manipulate URLs according…
permissive · top 15,000 on PyPI
url-normalizeStandardizes URLs to a canonical form by…
permissive · top 1,000 on PyPI
urlpyurlpy parses, normalizes, and compares URLs…
permissive · top 15,000 on PyPI
can-adaParses and manipulates URLs according to the…
permissive · top 15,000 on PyPI
rfc8785Implements RFC 8785 (JSON Canonicalization…
permissive · top 5,000 on PyPI
yarlyarl provides an immutable URL class for…
permissive · top 100 on PyPI
http-sfParses and serializes HTTP Structured Fields as…
permissive · top 15,000 on PyPI
jcsCanonicalizes JSON according to RFC 8785,…
permissive · top 5,000 on PyPI
http-sfvParses and serializes HTTP Structured Field…
permissive · top 15,000 on PyPI
ioc-fangerConverts defanged indicators of compromise…
permissive · top 15,000 on PyPI