urlpy
Simple URL parsing, canonicalization and equivalence.
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 urlpyuv
uv add urlpypoetry
poetry add urlpyInstalling 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
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
url-normalizeStandardizes URLs to a canonical form by…
permissive · top 1,000 on PyPI
urlcanonParses and normalizes URLs according to WHATWG…
permissive · top 15,000 on PyPI
furlfurl parses and manipulates URLs by providing a…
permissive · top 5,000 on PyPI
urlpathURLPath extends pathlib.PurePath to treat URLs…
permissive · top 15,000 on PyPI
domain2idnaConverts domain names and URLs to Punycode/IDNA…
permissive · top 15,000 on PyPI
pyfaup-rsParses URLs into components (scheme, host,…
copyleft · top 15,000 on PyPI
pyuriPyURI parses, constructs, and manipulates URIs…
permissive · top 15,000 on PyPI
rfc3986-validatorValidates URLs and URI references against the…
permissive · top 1,000 on PyPI
publicsuffixlistParses the Public Suffix List to extract the…
copyleft · top 5,000 on PyPI
tldextractAccurately extracts subdomain, domain, and…
permissive · top 1,000 on PyPI