purl: Build and Manipulate URLs in Python

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
View on GitHub

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 URL instances 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

View on GitHub

Related repositories

Similar repositories that may be relevant next.

OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️