skillfed

purl

An immutable URL class for easy URL-building and manipulation

purl v1.6 477.0K downloads/30d#6,444 on PyPI303
Permissive license MIT Abandoned released

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 purl

uv

uv add purl

poetry

poetry add purl

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python Modules

Tags

URL parsing and buildingimmutable URL classquery parameter manipulationURI template expansionURL construction APIRFC 6570 templatesURL interrogation
url-manipulationimmutable-datauri-templates

More Python Modules packages