--- id: urlpy version: "0.5" license: MIT license_treatment: permissive maintenance: dormant --- # urlpy — Simple URL parsing, canonicalization and equivalence. License: permissive · Maintenance: dormant · Downloads: 125.1K/mo ## 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 above — 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 pip install urlpy uv add urlpy 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: unspecified - Install friction: low - Maintenance: dormant - Downloads: 125.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags url parsing and normalization, url canonicalization, url equivalence testing, remove url parameters, punycode url handling, url path simplification, url cleanup library, url-parsing, canonicalization, web-utilities [View on SkillFed](https://skillfed.io/packages/urlpy) · [View on PyPI](https://pypi.org/project/urlpy/)