{"name":"furl: The Easiest Way to Parse and Modify URLs in Python","description":"furl is a lightweight Python library designed to simplify URL parsing and modification. It offers an intuitive API that makes common URL operations, often tedious with standard modules, straightforward and efficient. Developers can easily manipulate various URL components, including paths, query arguments, and fragments, with robust encoding handling.","github":"https://github.com/gruns/furl","url":"https://osrepos.com/repo/gruns-furl","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/gruns-furl","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/gruns-furl.md","json":"https://osrepos.com/repo/gruns-furl.json","topics":["python","url-parsing","url-manipulation","web-development","library","networking","utilities"],"keywords":["python","url-parsing","url-manipulation","web-development","library","networking","utilities"],"stars":null,"summary":"furl is a lightweight Python library designed to simplify URL parsing and modification. It offers an intuitive API that makes common URL operations, often tedious with standard modules, straightforward and efficient. Developers can easily manipulate various URL components, including paths, query arguments, and fragments, with robust encoding handling.","content":"## Introduction\n\n`furl` is a small yet powerful Python library that provides an exceptionally easy way to parse and modify URLs. While Python's standard `urllib` and `urlparse` modules offer URL-related functions, `furl` streamlines common operations, making URL manipulation intuitive and less prone to errors. It handles complex aspects like encoding and internationalized domain names seamlessly, allowing developers to focus on their application logic.\n\n## Installation\n\nInstalling `furl` is straightforward using pip:\n\nbash\npip install furl\n\n\n## Examples\n\n`furl` simplifies common URL operations. Here are a few examples demonstrating its ease of use:\n\n**Modifying Paths and Query Arguments:**\n\npython\nfrom furl import furl\n\nf = furl('http://www.google.com/?one=1&two=2')\nf /= 'path'\ndel f.args['one']\nf.args['three'] = '3'\nprint(f.url)\n# Output: 'http://www.google.com/path?two=2&three=3'\n\n\n**Inline Modification Methods:**\n\npython\nfrom furl import furl\n\n# Add arguments\nprint(furl('http://www.google.com/?one=1').add({'two':'2'}).url)\n# Output: 'http://www.google.com/?one=1&two=2'\n\n# Set arguments (replaces existing)\nprint(furl('http://www.google.com/?one=1&two=2').set({'three':'3'}).url)\n# Output: 'http://www.google.com/?three=3'\n\n# Remove arguments\nprint(furl('http://www.google.com/?one=1&two=2').remove(['one']).url)\n# Output: 'http://www.google.com/?two=2'\n\n\n**Handling Encoding and Unicode:**\n\n`furl` automatically handles URL encoding and supports Unicode characters.\n\npython\nfrom furl import furl\n\nf = furl('http://www.google.com/')\nf.path = 'some encoding here'\nf.args['and some encoding'] = 'here, too'\nprint(f.url)\n# Output: 'http://www.google.com/some%20encoding%20here?and+some+encoding=here,+too'\n\nf.set(host='????.???', path='???', query='?=?')\nprint(f.url)\n# Output: 'http://xn--eckwd4c7c.xn--zckzah/%D0%B4%D0%B6%D0%BA?%E2%98%83=%E2%98%BA'\n\n\n## Why Use furl?\n\n`furl` stands out by offering a highly intuitive and Pythonic interface for URL manipulation. It addresses the common frustrations associated with `urllib.parse` by providing direct access to URL components like scheme, host, path, query, and fragment. Key benefits include:\n\n*   **Simplicity**: Easily parse and modify any part of a URL with simple attribute assignments and dictionary-like access for query parameters.\n*   **Robust Encoding**: Automatically handles percent-encoding and decoding, including support for Unicode and Internationalized Domain Names (IDNs).\n*   **Method Chaining**: Supports inline modification methods (`add`, `set`, `remove`) for concise and readable code.\n*   **Detailed Control**: Offers granular control over path segments, query parameters (including multivalue support), and fragment components.\n*   **Well-Tested**: The library is thoroughly tested, ensuring reliability in various scenarios.\n\n## Links\n\n*   **GitHub Repository**: [https://github.com/gruns/furl](https://github.com/gruns/furl){:target=\"_blank\"}\n*   **PyPI**: [https://pypi.python.org/pypi/furl](https://pypi.python.org/pypi/furl){:target=\"_blank\"}","metrics":{"detailViews":1,"githubClicks":0},"dates":{"published":null,"modified":"2026-07-28T00:23:55.000Z"}}