ysskrishna logoysskrishna

Social Links

Detect, validate, and sanitize social media links in Python

Gallery image 1
Gallery image 2

Detect, validate, sanitize, and parse IDs from social profile URLs: many platforms, no extra dependencies

social-links is a pure Python helper for social URLs: auto-detect platform, check a link against a named platform, normalize to a canonical shape, and extract usernames or IDs. The README ships 65+ predefined platforms (major networks plus developer and creator sites) and allows custom regex-based platforms when you need more.

When it is useful

You ingest profile links from users, build directory or signup flows, or clean UGC before storage. Install from PyPI; docs and a browser demo are linked from the repository.

What you can do

  • Call the module-level API for typical cases or the SocialLinks class when you need custom lists or regex flags.
  • Extend or override platform definitions for internal domains or new networks.
  • Rely on pattern-based matching; understand that edge-case URLs may still need human review.

Limits

  • Validation is regex-driven, not a live probe of whether an account exists or is safe.
  • Platforms change URLs over time; pin versions and add tests for links you care about.
  • Phishing and lookalike domains are a separate security concern; do not treat “valid shape” as “trusted site.”

Frequently asked questions

What does Social Links do?

It is a pure Python, zero-dependency library for social profile URLs: auto-detect the platform, validate a link against a named platform, normalize to a canonical shape, and extract usernames or IDs.

How many platforms are included?

The README ships 65+ predefined platforms (major networks plus developer and creator sites). You can add or override platforms with custom regex patterns via the SocialLinks class.

How do I install it?

Install from PyPI with pip install social-links, or use uv pip install social-links. Module-level helpers cover typical cases; use the SocialLinks class when you need custom lists or regex flags.

Does validation prove an account exists?

No. Matching is regex-driven, not a live probe of whether an account exists or is safe. Treat valid shape as separate from trust; phishing and lookalike domains still need their own checks.

Continue exploring

ProductNested Utils

Nested Utils

Dot-path access made easy for Python's JSON, dict, and list structures.
PyPI Packages
Python
uv
PyPI
ProductPyPI Package Stats

PyPI Package Stats

CLI and library for PyPI download stats and metadata via the pypistats API, with disk caching.
PyPI Packages
Python
Typer
PyPI
ProductQuotes Convert

Quotes Convert

Convert matching double-quotes to single-quotes or vice versa in strings and streams
Text & Data Conversion
PyPI Packages
Python
uv
BlogCover image for Meet the Maker: Siva Sai Krishna Yenugu (ysskrishna)

Meet the Maker: Siva Sai Krishna Yenugu (ysskrishna)

PyPI Packages
Experimental Projects
4 min read
ProductDocker Detector

Docker Detector

Detect if Python process is running inside a Docker container
DevOps & Infrastructure
PyPI Packages
Python
uv
ProductVideo Extensions

Video Extensions

Check if a file or extension is a video type, iterate over 36 known video formats
File & Path Utilities
PyPI Packages
Python
uv