Remove tracking parameters from URLs
Project description
philiprehberger-url-clean
Remove tracking parameters from URLs.
Installation
pip install philiprehberger-url-clean
Usage
from philiprehberger_url_clean import clean, remove_params, normalize
# Remove tracking params (utm_*, fbclid, gclid, etc.)
clean("https://example.com/page?utm_source=twitter&id=123")
# "https://example.com/page?id=123"
# Remove specific params
remove_params("https://example.com?a=1&b=2&c=3", ["b", "c"])
# "https://example.com?a=1"
# Normalize URL
normalize("HTTPS://Example.COM/path/../page?b=2&a=1")
# "https://example.com/page?a=1&b=2"
# Batch processing
clean_many(["https://example.com?utm_source=x", ...])
API
clean(url, extra_params=None)— Remove known tracking parametersremove_params(url, params)— Remove specific parametersnormalize(url)— Lowercase host, sort params, resolve pathclean_many(urls, extra_params=None)— Batch clean
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file philiprehberger_url_clean-0.1.0.tar.gz.
File metadata
- Download URL: philiprehberger_url_clean-0.1.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6c0623be9f73b91afa9d2ee1131881b3624930ecbe532df7c20737783000401
|
|
| MD5 |
d3a6b0070b59cd5121227e2dc46eafec
|
|
| BLAKE2b-256 |
227958f703c4d953558f04576ebdbdc2f830a610da0069f41d9615a7fe357ef4
|
File details
Details for the file philiprehberger_url_clean-0.1.0-py3-none-any.whl.
File metadata
- Download URL: philiprehberger_url_clean-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97e56bcd6677ea98656f0911f5c54f0e0f5f3b0eaf437bf24e9f6f69309b24ae
|
|
| MD5 |
9e0a21384226f609c4419c09ffb6759c
|
|
| BLAKE2b-256 |
1cc6ea91fca7ed0f8542468c4f8f166b28f21133e7da075e6f4cbe19195c1b39
|