Changelog¶
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.5.0¶
Added¶
- 171 new platforms (171 new keys in
PREDEFINED_PLATFORMS): - AtCoder, Bilibili, Civitai, ClawHub, CodeChef, Discogs, Douban, eBay, Farcaster, Figma, Freelancer.com, GOG, Goodreads, Google Scholar, Habr, Hey.xyz, Hugging Face, Imgur, itch.io, Kick, Letterboxd, Lobsters, Misskey, Modrinth, MyAnimeList, Niconico, NuGet, Odysee, OpenSea, OpenStreetMap, osu!, Pixelfed, Pixiv, Poshmark, Primal, Qiita, Replicate, RubyGems, Scratch, SourceForge, SourceHut, Speedrun.com, Stack Exchange, Stan Store, Topcoder, Topmate, TryHackMe, Zenn.
- 500px, Airbnb, Ameba Blog, AniList, Are.na, Audioboom, Audiomack, Beacons, Bio.link, BitChute, Blogger, Brunch, Buttondown, Buy Me a Coffee, Campsite.bio, Cara, Carrd, Character.AI, Chub.ai, CHZZK, Codeberg, Codecademy, Codeforces, Codementor, CodeSandbox, Codewars, Contra, Coursera, crates.io, CSDN, CurseForge, Depop, DeviantArt, Douyu, Dzen, FACEIT, Fanfix, Flipboard, freeCodeCamp, Fur Affinity, Game Jolt, Genius, Gitee, Hatena Blog, Hoo.be, Huya, iNaturalist, Issuu, Jamendo, Juejin, KakaoTalk Channel, Khan Academy, Kickstarter, Ko-fi, Komoot, Last.fm, Launchpad, Lemon8, LINE, Malt, Mercari, Minds, Mixcloud, Naver Blog, Nimo TV, note, npm, OK.ru, Ollama, ORCID, OSF, Packagist, Paragraph, Pexels, RateYourMusic, Redbubble, ResearchGate, Roblox, Royal Road, Rutube, Scribd, Semantic Scholar, ShareChat, Sketchfab, Slashdot, solo.to, SOOP (AfreecaTV), start.gg, Taplink, The StoryGraph, Thingiverse, Throne, Tistory, Toyhouse, Trakt, Tripadvisor, Trustpilot, Truth Social, Udemy, Untappd, Velog, Vinted, Wattpad, Weights & Biases, XDA Forums, Xiaohongshu (RedNote), XING.
- About.me, Anaconda.org, Bugcrowd, GeeksforGeeks, HackerEarth, HackerOne, Hex, Indie Hackers, Instructables, Liberapay, MetaCPAN, Myspace, OnlyFans, Open Collective, TMDB, WordPress.org.
- Public constants
NUMERIC_ID,HEX32_ID,ORCID_IDandNOSTR_NPUBinsociallinks.constants. They are registered as bare-id patterns, sodetect_platform()still returnsNonefor a bare id.
Changed¶
- Tests: the happy path of every platform lives in one parametrized table,
tests/platforms/test_happy_path.py.
1.4.0¶
Fixed¶
- URL patterns are now anchored at the start of the input. Previously a URL embedded at the end of a longer string was accepted, for example
is_valid("github", "https://evil.com/?r=https://github.com/foo")returnedTrue. detect_platform()no longer guesses a platform from a bare ID:detect_platform("johndoe")returned"behance", now it returnsNone. Prefixed shorthands such asu/foo,r/pythonandspotify:artist:...are still detected.is_valid(),sanitize()andextract_id()still accept bare IDs for the platform you name.- YouTube:
/channel/UC...URLs now sanitize tohttps://youtube.com/channel/UC.... The previous output,https://youtube.com/UC..., is a 404. set_platform()no longer leavesplatformsand the compiled patterns out of sync when compilation fails, andset_platforms()is all-or-nothing.- Stale docstring examples and the
SyntaxWarninginsociallinks/constants.py.
Changed¶
- Share links with tracking parameters or fragments are accepted:
https://www.instagram.com/foo/?igsh=abc,https://x.com/foo?s=20,https://github.com/foo#readme. The input is matched as given first (so platforms that need a query string or fragment, such as Hacker News?id=, keep working), then again without them. Generic site paths such aswatch,searchorprofile.phpare rejected on that second pass, soyoutube.com/watch?v=...is not read as a profile. - Threads and Exercism follow their new domains:
sanitize()now returnshttps://threads.com/@{id}andhttps://exercism.org/profiles/{id}. The oldthreads.netandexercism.iohosts are still accepted as input. set_platform()/set_platforms()validate their input and raiseInvalidPlatformErrorfor non-dict entries, entries without patterns, andsanitizedtemplates that lack{id}or use other placeholders. These were previously skipped or accepted silently.- Error messages for mismatches, empty URLs and failed ID extraction now name the platform and (truncated) URL.
- Patterns passed to
set_platform()are matched withre.matchinstead ofre.search. A custom pattern that relied on matching in the middle of a string must now match from the start. - README: collapsible sections, "Built and maintained by" section, and URL-handling notes.
- CI runs on Python 3.8 to 3.13 and lints with ruff.
Added¶
- Facebook
profile.php?id=<digits>URLs, Signal phone links (https://signal.me/#p/+15555555555) and Medium<name>.medium.comprofile URLs. - Python 3.13 classifier.
scripts/gen_platform_docs.pykeeps the README platform table and the "N+ platforms" counts in sync with the code; a test fails when they are stale.- "Adding a Platform" guide in
CONTRIBUTING.md.
1.3.1¶
Added¶
- New
extract_id()function to extract usernames/profile IDs from URLs: - Available as both module-level function and
SocialLinksclass method - Works seamlessly with all supported platforms
- Example:
extract_id("linkedin", "https://linkedin.com/in/johndoe")returns"johndoe" - Support for 15 new platforms:
- Developer: CodePen, HackerRank, Kaggle, LeetCode, PyPI, Replit, Docker Hub
- Creative: ArtStation, Unsplash
- Gaming: Chess.com, Lichess
- Video: Dailymotion, Rumble
- Other: Fiverr, Trello, WordPress
Changed¶
- Redesigned interactive demo page:
- Modern tabbed interface for all operations (detect, validate, sanitize, extract_id, list)
- Real-time Python code preview for each operation
- Quick stats bar showing instant platform detection and validation
- Pre-loaded examples for easy testing
- Updated documentation to reflect 65+ supported platforms
- Improved README footer with better link organization
1.3.0¶
Added¶
- Module-level convenience functions for simplified API usage:
detect_platform(url)- Detect platform from URL without instantiating SocialLinksis_valid(platform_name, url)- Validate URL for a specific platformsanitize(platform_name, url)- Sanitize URL to canonical formatlist_platforms()- List all supported platform names- Separate documentation pages for better organization:
basic-api.md- Documentation for module-level convenience functionscore-api.md- Documentation for SocialLinks class and advanced featuresconstants.md- Documentation for constants and type aliasesexceptions.md- Documentation for exception hierarchy- Add test cases for module-level functions.
Changed¶
- Enhanced README with improved Quick Start section using module functions
- Added comprehensive "Basic Usage" section with extensive examples
- Improved README organization with clearer separation between basic and advanced usage
1.2.1¶
Added¶
- Interactive demo page in documentation with Pyodide integration
- Browser-based testing interface for detecting platforms, validating URLs, and sanitizing links
- No installation required - runs entirely in the browser
- Real-time platform detection and validation feedback
- Demo badge in README linking to interactive demo
- Prominent callout in README highlighting the interactive demo feature
Changed¶
- Enhanced README visibility for demo page with badge and callout placement
- Improved user experience with easier access to interactive testing
1.2.0¶
Added¶
- Support for 28 new social media platforms:
- Music & Audio: Apple Music, Bandcamp
- Video Platforms: Douyin, Kuaishou, Vimeo
- Social Networks: Bluesky, Discord, Reddit, Snapchat, Tumblr, Threads (Instagram)
- Professional & Business: Crunchbase, GitLab, HackerNews, ProductHunt, Wellfound (AngelList)
- E-commerce & Marketplaces: Etsy, Gumroad
- Content & Publishing: Hashnode, Slideshare
- Messaging & Communication: Signal, WeChat, WhatsApp
- Photo & Media: Flickr, Gravatar
- Gaming: Steam
- Q&A & Forums: Quora
- Chinese Platforms: Weibo
InvalidPlatformRegexErrorexception for handling invalid regex patterns in platform configurationsconstants.pymodule with reusable regex patterns and type aliases for platform configuration- Comprehensive API reference documentation
- Function and constant docstrings throughout the codebase
- Roadmap section in README
- Google verification key for documentation
- SEO meta tags and title templates for documentation pages
- Common test patterns module for parametrized testing across platforms
Changed¶
- Enhanced platform pattern matching:
- LinkedIn: Added support for school URLs and improved pattern matching with
%character support - Reddit: Added support for subreddit URLs and
u/prefix format - Telegram: Enhanced with additional URL patterns
- Spotify: Added support for artist profile URLs and improved user profile patterns
- Quora: Added support for Unicode characters in profile URLs
- Substack: Updated URL patterns for better matching
- WhatsApp: Added support for send URL format
- YouTube: Fixed channel pattern matching
- Refactored exception hierarchy:
- Introduced
PlatformErroras base class for platform-related errors - Introduced
URLParsingErroras base class for URL parsing errors - Improved error categorization and inheritance structure
- Refactored test suite:
- Split monolithic
test_platforms.pyinto individual platform-specific test files - Added
conftest.pyfor shared test fixtures - Parametrized common test cases (www, http, trailing_slash) for better coverage
- Updated README:
- Formatted predefined platforms in a table for better readability
- Removed outdated error handling section
- Enhanced
pyproject.tomlwith improved keywords and metadata - Improved documentation structure with better organization and SEO optimization
Fixed¶
- Fixed YouTube channel pattern matching issues
- Fixed sanitization pattern edge cases
- Fixed documentation bugs
1.1.0¶
Added¶
- MkDocs documentation setup with Material theme
- Comprehensive Contributing Guide (CONTRIBUTING.md) with development setup instructions
- GitHub Actions workflow for automated documentation deployment
- Documentation badge in README linking to hosted documentation
- Links section in README with all project resources
- Added py.typed file for type hinting
Changed¶
- Updated README with clickable links for all 25+ supported platforms
- Enhanced README structure with Changelog, Contributing, and Support sections
- Improved documentation organization with dedicated docs/ directory
1.0.0¶
Added¶
- Initial release of social-links
SocialLinksclass for detecting and sanitizing social media URLsdetect_platform()method for automatically detecting platform from URLis_valid()method for validating URLs against specific platformssanitize()method for normalizing URLs to canonical format- Platform management methods:
set_platform()- Add or override a single platformdelete_platform()- Remove a single platformset_platforms()- Bulk add/override platformsdelete_platforms()- Bulk remove platformsclear_platforms()- Remove all platformsget_platform()- Retrieve platform configurationlist_platforms()- List all registered platforms- Support for 25+ predefined social media platforms:
- behance, dev_to, dribbble, exercism, facebook, github, instagram, keybase, lemmy_world, linkedin, linktree, mastodon, medium, patreon, pinterest, soundcloud, spotify, stackoverflow, substack, telegram, tiktok, twitch, vk, x (Twitter), youtube
- Custom regex pattern support for flexible URL matching
- Multiple pattern support per platform
- Automatic ID extraction from URLs
- Support for various URL formats (with/without protocol, www, mobile variants)
- Customizable regex flags for pattern matching
- Comprehensive error handling with custom exceptions:
SocialLinksError- Base exceptionPlatformNotFoundError- Platform not foundPlatformAlreadyExistsError- Platform already existsInvalidPlatformError- Invalid platform configurationPlatformIDExtractionError- Failed to extract platform IDURLMismatchError- URL doesn't match platform pattern- Full test coverage with comprehensive test suite
Features¶
- Zero external dependencies
- Python 3.8+ compatibility
- Case-insensitive URL matching (configurable)
- Support for username-only input (without full URLs)
- Automatic @ symbol handling
- URL normalization and sanitization