purl: Build and Manipulate URLs in Python

Summary
purl is a Python library for inspecting and transforming URLs through an immutable, chainable API. It suits applications that need structured URL handling, query-parameter updates, or RFC 6570 template expansion without assembling URL strings manually.
At a glance
- Language
- Python
- License
- MIT
- Stars
- 303
- Forks
- 37
- Added to OSRepos
- July 27, 2026
- Last analyzed
- October 3, 2026
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Overview
purl provides a Python URL class for working with URL components such as schemes, hosts, paths, query parameters, and fragments. It addresses the brittleness of assembling or editing URLs as plain strings by offering methods to inspect and transform those parts directly.
URL instances are immutable: operations that change a URL return a new instance. The library also supports RFC 6570 URI templates, making it useful for both ordinary URL manipulation and template-based URL generation.
Key Features
- Construct URLs from a string or from component keywords.
- Inspect scheme, host, path, query, fragment, credentials, and other URL parts.
- Add, change, or remove path segments and query parameters through a fluent API.
- Treat
URLinstances as immutable values, with support for equality, pickling, and dictionary keys. - Expand URI templates using RFC 6570 syntax.
- Install from PyPI with
pip.
Use Cases
- Python web applications can update query parameters while preserving the rest of a URL.
- API clients can build endpoint URLs from path segments and parameters without hand-concatenating strings.
- Tools that consume or produce URI templates can expand them with supplied values.
- Tests can compare, reuse, or serialize URLs as values without worrying about in-place mutation.
Project Facts
- Language: Python
- License: MIT
- Stars: 303
- Forks: 37
- Topics: none listed
- Archived: no
Getting Started
Install the published package:
pip install purl
See the README and documentation for API examples and details.
Alternatives
- furl: furl edits parsed URL components and rebuilds the URL, while purl uses an immutable, chainable API for URL transformations.
Considerations
The README documents support for Python 2.7 and Python 3.3 through 3.8, plus PyPy. This is an older compatibility range, so check the package and test it against your target Python version before adopting it. The repository is not marked archived, but its latest push was in 2023; confirm that its maintenance and compatibility meet your needs.
Found this useful?
Share it with someone who would like purl.
Comparisons
Source repository
Open the original repository on GitHub.
22 counted GitHub visits
Related repositories
Similar repositories that may be relevant next.

omnigent: Orchestrate AI Coding Agents Across Harnesses
October 5, 2026
Omnigent provides a shared orchestration layer for AI coding agents, with policies, sandboxing, and team collaboration. It suits developers who want to combine agent runtimes and access sessions across devices without tying workflows to one harness.

agentevals: Evaluate AI Agents from OpenTelemetry Traces
October 4, 2026
agentevals scores AI agent behavior from existing OpenTelemetry traces, without rerunning agents or making extra model calls. It suits teams building instrumented agents that need local evaluation, golden-set checks, or CI quality gates.

web-design: Create Consistent Web Pages with a Claude Code Skill
October 3, 2026
web-design is a Claude Code skill that turns product briefs, reference URLs, or screenshots into an editable design specification before generating web code. It is suited to developers and designers who want a repeatable, spec-led workflow for building consistent pages.

oomwoo: Build a DIY Robot Vacuum
October 2, 2026
OOMWOO is a planned, hackable robot vacuum built around Raspberry Pi, ROS2 and 2D LiDAR. It is aimed at makers who want to build and customize a locally controlled vacuum, but its hardware and build instructions are still in development.