Skip to main content

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 parameters
  • remove_params(url, params) — Remove specific parameters
  • normalize(url) — Lowercase host, sort params, resolve path
  • clean_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

philiprehberger_url_clean-0.1.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

philiprehberger_url_clean-0.1.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file philiprehberger_url_clean-0.1.1.tar.gz.

File metadata

File hashes

Hashes for philiprehberger_url_clean-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fea847a4e6123cabfd37e38c6eebd306cc162201b4c80a43933308acb2d017a3
MD5 19a7259466c767cbaa7da9b35b62ccfd
BLAKE2b-256 dc5d4e828400e03d446f97e8fd37a99c53246215490b284635f3af50670af4e2

See more details on using hashes here.

File details

Details for the file philiprehberger_url_clean-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for philiprehberger_url_clean-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c7a43deb5d62db499c807e9924343cfc71b9dcf9e51bfa57ab9dcd1253393dde
MD5 848981cd13f1772d0c3a9bb6be0df4ef
BLAKE2b-256 fa5b51f7a43a0cc834606f84275faf39f5c3d673d79bfaff8f126f278d2dae38

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page