skillfed

urlcanon

url canonicalization library for python and java

urlcanon v0.3.1 147.6K downloads/30d#11,060 on PyPI43
Permissive license Abandoned released

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 urlcanon

uv

uv add urlcanon

poetry

poetry add urlcanon

Installing 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

License :: OSI Approved :: Apache Software LicenseProgramming Language :: JavaProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Topic :: Internet :: WWW/HTTP

Tags

url canonicalization normalizationurl parser browser standardwhatwg url parsingssurt url serializationurl normalization libraryparse url bytes preservedurl prefix matching
url-parsingabandoned

More WWW/HTTP packages