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.
Using an AI coding agent? See
llms.txt— an LLM-oriented reference covering the full API, the persistent-cache recipe, and the behavioral contracts (caching, TTLs, rate limits, error handling) that function signatures don't reveal.
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.
Metadata
Release files for clean_links 0.2.2
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 | |
|---|---|---|---|---|
| clean_links-0.2.2.tar.gz | 38.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| clean_links-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 78.7 kB
Release files / clean_links-0.2.2.tar.gz
| Download URL | clean_links-0.2.2.tar.gz |
|---|---|
| Size | 38.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
02a7112a44e7479bef8b55acfa9f78f0fd10321576088ebceb80caa4ce70c253
|
|
BLAKE2b-256 checksum How to use checksums |
28a2d483f996d98c2eb0ef75b9bf57e9af6b9a3ea200dfb55eb792e5d125435e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.12.14 Linux/6.17.0-1022-azure
|
Release files / clean_links-0.2.2-py3-none-any.whl
| Download URL | clean_links-0.2.2-py3-none-any.whl |
|---|---|
| Size | 40.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2201b7195b61c4c0d9508ae82ee98cf65cafeaced0094e44d1b18cf8995a9660
|
|
BLAKE2b-256 checksum How to use checksums |
719edc9c8b15d275fa0c95400580598b23350a94cb9456824af15b03ee8b2049
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.12.14 Linux/6.17.0-1022-azure
|
Security for clean_links 0.2.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.