skillfed

urlpy

Simple URL parsing, canonicalization and equivalence.

urlpy v0.5 125.1K downloads/30d#11,836 on PyPI1
Permissive license MIT DORMANT released

What it is and what it does

urlpy is a pure-Python URL parser and normalizer that provides a chainable API for manipulating and comparing URLs. At its core is a URL object created by parsing a string; you can then chain methods like defrag(), deparam(), escape(), punycode(), and abspath() to transform the URL into a canonical form. The package also supports URL equivalence testing via the equiv() method, which treats URLs as functionally equivalent even when they differ in case, parameter order, default ports, or punycode encoding.

The library depends on publicsuffix2 for domain suffix handling and is designed to work on both Python 2 and Python 3 using only pure Python code. It offers fine-grained control over URL components (scheme, host, port, path, query, fragment) and supports operations like removing tracking parameters, normalizing paths with .. and . resolution, and converting non-ASCII characters to percent-encoded UTF-8.

Use it for:

  • Deduplicate URLs by using equiv() to identify functionally identical URLs despite cosmetic differences
  • Clean tracking parameters like utm_source and session IDs from URLs before storing or comparing
  • Normalize URLs to canonical form for indexing, caching, or URL-based deduplication in data pipelines
  • Escape and punycode international domain names and paths for consistent HTTP requests
  • Resolve relative URL paths with .. and . segments to absolute paths for validation or comparison

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

urlpy parses, normalizes, and compares URLs with support for defragmentation, parameter removal, path simplification, punycode encoding, and equivalence testing.

Yes, if you need URL normalization and equivalence testing in a lightweight package with low install friction and permissive licensing. However, dormant maintenance (last release 2020-04-28) means you should verify compatibility with your Python version and be prepared to fork or patch if issues arise. Not suitable if you require active support or expect the package to evolve.

Install

urlpy on PyPI

pip

pip install urlpy

uv

uv add urlpy

poetry

poetry add urlpy

Installing urlpy

Before you install

Low install friction with a single pure-Python dependency. Maintenance is dormant—last release was 2020-04-28 with no commits since 2024-08-21—so expect no active bug fixes or feature updates.

License in practice

MIT license is permissive, allowing commercial and private use with minimal restrictions; you may use, modify, and distribute freely provided you retain the license notice.

Quickstart

import urlpy
myurl = urlpy.parse('http://foo.com/?b=2&a=1#fragment')
result = str(myurl.defrag().deparam(['b']).canonical())

Verify before relying

  • Whether the package works reliably on modern Python versions (python_support is unspecified)
  • Whether publicsuffix2 dependency remains actively maintained and compatible with current ecosystems

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — publicsuffix2
Maintenance dormant — 2,299 days since the last release
Last repo commit
First released
Downloads 125,109/month — #11,836 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: urlpy-0.5-py2.py3-none-any.whl

Development Status :: 3 - AlphaEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseTopic :: Internet :: WWW/HTTP

Tags

url parsing and normalizationurl canonicalizationurl equivalence testingremove url parameterspunycode url handlingurl path simplificationurl cleanup library
url-parsingcanonicalizationweb-utilities

More WWW/HTTP packages