🔗 url-unwrap
Unwrap redirect links and remove tracking parameters with the ClearURLs rules.
Installation
Install the package from PyPI:
pip install url-unwrap
Usage
Unwrap a URL like this:
from url_unwrap import unwrap
unwrap("https://www.google.com/url?q=https://example.org/a%3Fid%3D7%26utm_source%3Dx&sa=U")
# 'https://example.org/a?id=7'
Redirect links are followed until the target is reached, and tracking parameters (like utm_source) are removed along the way.
Besides the ClearURLs rules, search result links from Google Images, Bing, and Yahoo are also unwrapped.
The ClearURLs rules are downloaded once and then shared. To use a local copy of the rules instead, load them from a file:
from url_unwrap import Providers, unwrap
providers = Providers.from_file("data.minify.json")
unwrap("https://example.org/?utm_source=x", providers)
# 'https://example.org/'
Development
To build this package and contribute to its development you need to install the build, setuptools and wheel packages:
pip install build setuptools wheel
(On most systems, these packages are already pre-installed.)
Then, install the package and test dependencies:
pip install -e .[tests]
You can now verify your changes against the test suite.
ruff check . # Code format and LINT
mypy . # Static typing
pytest . # Unit tests
Please also add tests for your newly developed code.
Build wheels
Wheels for this package can be built with:
python -m build
Support
If you hit any problems using this package, please file an issue. We're happy to help!
License
This repository is released under the MIT license. The ClearURLs rules are released under the LGPL-3.0 license and are downloaded, not bundled.
Metadata
Release files for url-unwrap 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| url_unwrap-0.1.1.tar.gz | 9.5 kB | With provenance | Details for url_unwrap-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| url_unwrap-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for url_unwrap-0.1.1-py3-none-any.whl |
Total release size: 16.4 kB
Release files / url_unwrap-0.1.1.tar.gz
| Download URL | url_unwrap-0.1.1.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
588e00d7a22b74957a88563d016a71d9294740af1913077495a10948732e28de
|
|
BLAKE2b-256 checksum How to use checksums |
6cce19e22708989d980d7d24f593f5aa0619914059656efbddc00251be7d6a5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.
Transparency logRelease files / url_unwrap-0.1.1-py3-none-any.whl
| Download URL | url_unwrap-0.1.1-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c663fefee86b1de14412c1250f705c59e6504fbb106c4d69b2bab502c7fde0f
|
|
BLAKE2b-256 checksum How to use checksums |
d2644603e20e9b1f1ff4d221f440e33a3f732c9d89271421ca7c39851fed935a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.
Transparency logSecurity for url-unwrap 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for url_unwrap-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.