Clean Links
Decide whether two links point at the same resource — so you can
de-duplicate and count links shared across feeds (a Nuzzel-style use case).
Shorteners hide the destination and per-share tracking parameters mean the final
URLs rarely match as strings; clean-links follows the redirects, strips the
cruft, and compares what's left.
Install with:
pip install clean_links
Are two shortened, tracking-tagged links the same article?
>>> from clean_links import are_equivalent_sync
>>> are_equivalent_sync(
... "https://bit.ly/some-short-link",
... "https://trib.al/another-one",
... )
True
Or count how many links in a batch point at the same thing:
>>> from clean_links import group_sync
>>> groups = group_sync([
... "https://bit.ly/some-short-link",
... "https://trib.al/another-one",
... "https://example.com/unrelated",
... ])
>>> {key: len(members) for key, members in groups.items()}
{'https://www.bloomberg.com/news/articles/...': 2, 'https://example.com/unrelated': 1}
These calls make live network requests to follow the redirects. The library is
async-first — drop the _sync suffix for the coroutine API — and an
Engine with a SqliteStore resolves each link once and reuses it across runs.
See the documentation here.
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 clean_links-0.2.0.tar.gz.
File metadata
- Download URL: clean_links-0.2.0.tar.gz
- Upload date:
- Size: 36.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/2.4.1 CPython/3.12.14 Darwin/25.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ba61a92ef434e27ed1ab02fd08dda4b5d77ac5e03864db8c84cb5cbbfd0158c
|
|
| MD5 |
1aff3c0407fea8879aa460967b2b6df6
|
|
| BLAKE2b-256 |
d5c0a57113cdeb0cb7fdd9d249ccea07eac8db28ab627ec6e8a16187c9991548
|
File details
Details for the file clean_links-0.2.0-py3-none-any.whl.
File metadata
- Download URL: clean_links-0.2.0-py3-none-any.whl
- Upload date:
- Size: 39.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/2.4.1 CPython/3.12.14 Darwin/25.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a79ebe6404b97eb358fb452da50cb3b01ec6198abcf778811cef9d541dc542c
|
|
| MD5 |
d042906bb1021803221b24807f31d876
|
|
| BLAKE2b-256 |
5873a83cda79d152c38147c8ac39d29de37ce849da66b06d999c1de7c24f1db6
|