furl
The easiest way to parse and modify URLs in Python
...The library supports simple path editing, query argument changes, fragment manipulation, inline method chaining, and URL joining. It also handles encoding automatically, including percent-encoding, Unicode domains, Unicode paths, and query strings. furl supports Python 3 and PyPy3 and is designed to be well tested and practical for everyday backend, scripting, and data-processing workflows. It is a good fit for developers who frequently need to clean, transform, generate, or normalize URLs in Python applications.