Your form accepts a profile link. Half your rows are not the same link twice.
Someone types twitter.com/jane. Someone else pastes a full x.com link with tracking parameters. A third person drops a linkedin.com/in/ URL with trailing junk. You are about to store three strings that mean the same person on three different platforms, and your dedupe job just got harder.
Social Links is the small Python library that spots the platform, checks the shape, normalizes the URL, and hands you the handle.
One messy paste in. One canonical link out.
What you get
- Platform detection without a giant if-chain. Pass a URL and learn whether it is LinkedIn, GitHub, X, Instagram, or one of many others already built in.
- Validation that matches how people actually paste. Check a link against a named platform, including bare usernames when you already know the network.
- Canonical URLs for storage and compare. Strip leading www, old hostnames, and share-link noise so two rows that mean the same profile line up.
- Handles you can index. Pull the username or profile id without writing a regex per site.
- Room to grow. Add or override platforms with your own patterns when you hit an internal tool or a network the defaults do not cover.
- No extra packages. Pure Python with zero dependencies, so it stays easy to drop into an API or a batch job.
Picture your signup export
An illustrative case: a CSV of social profile fields lands on Monday. Rows mix http and https, mobile LinkedIn paths, and legacy Twitter hosts. You run detection and sanitization before insert. The table stores canonical linkedin.com/in/jane and x.com/jane URLs, and handle extraction returns jane for both networks. Duplicate review stops being a spelling contest.
Try it in your browser first
No install required. The interactive demo runs in the browser so you can paste real links and see detection, validation, sanitization, and id extraction before you wire it into your app.








