Social Account Detection for Python
Project description
Socials
Social Account Detection and Extraction for Python
- Free software: GNU General Public License v3
- Documentation: https://socials.readthedocs.io
- Source: https://github.com/lorey/socials
Features
- Detect and extract URLs of social accounts: throw in URLs, get back URLs of social media profiles by type.
- Supports Facebook, Twitter, LinkedIn, GitHub, Instagram, YouTube, and email addresses.
Installation
pip install socials
Or with uv:
uv add socials
Usage
Python API
import socials
hrefs = [
"https://facebook.com/peterparker",
"https://techcrunch.com",
"https://github.com/lorey",
]
# Get all matches grouped by platform
socials.extract(hrefs).get_matches_per_platform()
# {'facebook': ['https://facebook.com/peterparker'], 'github': ['https://github.com/lorey'], ...}
# Get matches for a specific platform
socials.extract(hrefs).get_matches_for_platform("github")
# ['https://github.com/lorey']
CLI
# Check which platform a URL belongs to
socials check https://github.com/lorey
# github
# Extract social URLs from a file
socials extract urls.txt
# Extract from stdin
echo "https://github.com/lorey" | socials extract
Socials API
There's also Socials API that allows you to use the functionality via REST. You can use a free online version, try it in the browser, or deploy it yourself.
Development
# Clone and install
git clone https://github.com/lorey/socials
cd socials
uv sync --extra dev
# Run tests
uv run pytest
# Run linting
uv run ruff check .
uv run mypy socials
# Format code
uv run ruff format .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
socials-0.3.0.tar.gz
(74.9 kB
view details)
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
socials-0.3.0.tar.gz.File metadata
File hashes
f8cf692ddefe6a6d6ba3525d60c38357b8b2bb2d81a3a4080726bc3d76237d3fcdd22b1a9ca04a201293c8698929c4d3b5b316c6e6dcd2fdf3914a849844b13f8a79d1f20194b17b9d564710b53a5a22See more details on using hashes here.
Provenance
The following attestation bundles were made for
socials-0.3.0.tar.gz:Publisher:
Attestations: Values shown here reflect the state when the release was signed and may no longer be current.release.ymlon lorey/socials-
Statement type:
-
Predicate type:
-
Subject name:
-
Subject digest:
-
Sigstore transparency entry: 782285795
- Sigstore integration time:
Source repository:https://in-toto.io/Statement/v1https://docs.pypi.org/attestations/publish/v1socials-0.3.0.tar.gzf8cf692ddefe6a6d6ba3525d60c38357b8b2bb2d81a3a4080726bc3d76237d3f-
Permalink:
-
Branch / Tag:
-
Owner: https://github.com/lorey
-
Access:
Publication detail:lorey/socials@f41070f3aeac9237809afc9b3df46ae23d088bb3refs/tags/v0.3.0publichttps://token.actions.githubusercontent.comgithub-hostedrelease.yml@f41070f3aeac9237809afc9b3df46ae23d088bb3push