Skip to main content

PyPI GitHub Workflow Status (branch) PyPI - Downloads PyPI - Python Version PyPI - License

no-more-query-string

Remove unneccessary query-string from the URL given. Especially fbclid.

Changelog

Installation

pip install no-more-query-string

Usage

from no_more_qs import NoMoreQS

nmq = NoMoreQS()
url = "https://www.youtube.com/watch?v=h-RHH79hzHI&feature=emb_logo&ab_channel=Ceia"

nmq.clean(url)
# 'https://www.youtube.com/watch?v=h-RHH79hzHI'

or you just want to remove fbclid

url = "https://www.youtube.com/watch?v=h-RHH79hzHI&feature=emb_logo&ab_channel=Ceia&fbclid=IwAR2NasdasdasdadasdfP58isTW-c3U"

NoMoreQs.remove_fbclid(url)
# 'https://www.youtube.com/watch?v=h-RHH79hzHI&feature=emb_logo&ab_channel=Ceia'

Parameters

fbclid will be cleaned from all domains

# default
NoMoreQS(include_flds=[], exclude_flds=[], strict=True)

include_flds ( List[str] | Tuple[str]=[] )

first-level domains list which are allowed to clean query string.

include_flds = ('youtube.com', 'google.com')

url = "https://www.youtube.com/watch?v=h-RHH79hzHI&feature=emb_logo&ab_channel=Ceia&fbclid=IwAR2NasdasdasdadasdfP58isTW-c3U"

NoMoreQS(include_flds=include_flds).clean(url)
# 'https://www.youtube.com/watch?v=h-RHH79hzHI'

exclude_flds ( List[str] | Tuple[str]=[] )

first-level domains which are disallowed to clean query string.

exclude_flds = ('youtube.com', 'google.com')

url = "https://www.youtube.com/watch?v=h-RHH79hzHI&feature=emb_logo&ab_channel=Ceia&fbclid=IwAR2NasdasdasdadasdfP58isTW-c3U"

NoMoreQS(exclude_flds=exclude_flds).clean(url)
# 'https://www.youtube.com/watch?v=h-RHH79hzHI&feature=emb_logo&ab_channel=Ceia'

strict ( bool=True )

if the domain is not in include_flds or exclude_flds

  • True(default): Remove all unneccessary query string.
  • False: Only remove fbclid from query string.
url = "https://www.youtube.com/watch?v=h-RHH79hzHI&feature=emb_logo&ab_channel=Ceia&fbclid=IwAR2NasdasdasdadasdfP58isTW-c3U"

NoMoreQS(strict=True).clean(url)
# 'https://www.youtube.com/watch?v=h-RHH79hzHI'

NoMoreQS(strict=False).clean(url)
# 'https://www.youtube.com/watch?v=h-RHH79hzHI&feature=emb_logo&ab_channel=Ceia'

Metadata

Release files for no-more-query-string 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for no-more-query-string 0.0.8
File Size Uploaded
no-more-query-string-0.0.8.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for no-more-query-string 0.0.8
File Interpreter ABI Platform
no_more_query_string-0.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 9.9 kB

Release files / no-more-query-string-0.0.8.tar.gz

Download URL no-more-query-string-0.0.8.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8f5fa91c4ae13a9a10ec64f86aa9ad8225707d8f76ae63c549dee68d4929c49c
BLAKE2b-256 checksum
How to use checksums
f3369d0910be23405010993913f40c299ad40d8c4df1ad83d1196b1fb74c306f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

Release files / no_more_query_string-0.0.8-py3-none-any.whl

Download URL no_more_query_string-0.0.8-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
236ac2b00735c3a11179b15aee5f50a9283104b822261ce8a65928e926dfdac6
BLAKE2b-256 checksum
How to use checksums
a2540f2388ce82743f4072033c7c99a908734b2099bd9ed19574f0227027086f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

Release history Release notifications | RSS feed

This release

0.0.8 This release

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page