purl
An immutable URL class for easy URL-building and manipulation
What it is and what it does
purl is a lightweight URL manipulation library that wraps Python's URL handling in an immutable, fluent API. You construct URLs from strings or keyword arguments, then interrogate or mutate them through chainable methods—each mutation returns a new instance, so URLs can safely be used as dictionary keys or pickled. The library also implements RFC 6570 URI template expansion for dynamic URL generation.
Typical use is building query strings, extracting URL components, or transforming URLs step-by-step without managing raw strings. It has no runtime dependencies and was designed to work across Python 2.7 and Python 3 versions, though the project has not been actively maintained since its latest release on 2021-05-15.
Use it for:
- Build query strings and URLs programmatically without string concatenation or manual encoding.
- Extract and manipulate URL components (scheme, host, path, query params) with a readable API.
- Use URLs as dictionary keys or in sets, since instances are immutable and hashable.
- Expand RFC 6570 URI templates with variable substitution for dynamic endpoint construction.
- Parse and modify existing URLs while preserving structure and handling special characters.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides an immutable, chainable URL class for constructing, parsing, and manipulating URLs with a clean API, plus support for RFC 6570 URI template expansion.
Yes, if you need lightweight URL manipulation without dependencies and can accept that the project is no longer maintained. The API is clean and the library is stable for basic URL building and parsing. No, if you require active maintenance, security updates, or support for the latest Python features—consider urllib.parse for standard library alternatives or a more actively maintained URL library.
Install
purl on PyPI
pip
pip install purluv
uv add purlpoetry
poetry add purlInstalling purl
Before you install
Installation is straightforward with no runtime dependencies. The project is marked abandoned with the last commit in 2023, so expect no active maintenance or security updates.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
from purl import URL
u = URL('https://www.google.com/search?q=testing')
print(u.query_param('q')) # 'testing'
new_url = u.path('/new').query_param('q', 'updated')
print(new_url.as_string())
Verify before relying
- Whether the package remains compatible with Python versions released after 2021.
- Whether RFC 6570 template expansion handles all edge cases in modern use.
- Current stability and real-world usage patterns given the abandoned maintenance status.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,917 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 476,992/month — #6,444 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: purl-1.6-py2.py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
packageurl-pythonParses and builds Package URLs (purls) —…
permissive · top 1,000 on PyPI
uritemplateExpands RFC 6570 URI templates by substituting…
permissive · top 1,000 on PyPI
uri-templateExpands RFC 6570 URI Templates with variable…
permissive · top 1,000 on PyPI
std-uritemplateExpands RFC 6570 URI Templates (Level 4) by…
permissive · top 5,000 on PyPI
hyperlinkHyperlink provides an immutable, RFC…
permissive · top 1,000 on PyPI
URLObjectURLObject provides a utility class for parsing,…
permissive · top 15,000 on PyPI
furlfurl parses and manipulates URLs by providing a…
permissive · top 5,000 on PyPI
query-stringParses URL query strings and fragments into…
permissive · top 15,000 on PyPI
urlpathURLPath extends pathlib.PurePath to treat URLs…
permissive · top 15,000 on PyPI
url-normalizeStandardizes URLs to a canonical form by…
permissive · top 1,000 on PyPI