Skip to main content

Social Account Detection for Python

Project description

Socials

PyPI CI Documentation

Social Account Detection and Extraction for Python

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

socials-0.3.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file socials-0.3.0.tar.gz.

File metadata

  • Download URL: socials-0.3.0.tar.gz
  • Upload date:
  • Size: 74.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for socials-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f8cf692ddefe6a6d6ba3525d60c38357b8b2bb2d81a3a4080726bc3d76237d3f
MD5 cdd22b1a9ca04a201293c8698929c4d3
BLAKE2b-256 b5b316c6e6dcd2fdf3914a849844b13f8a79d1f20194b17b9d564710b53a5a22

See more details on using hashes here.

Provenance

The following attestation bundles were made for socials-0.3.0.tar.gz:

Publisher: release.yml on lorey/socials

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file socials-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: socials-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for socials-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80e3a13fa60cb20a0f2b71ea4d461bdf51a9bd7f4d10cb41cdd435aa5e0fb1c6
MD5 8be17f5671d0dc4919a076d8933859a5
BLAKE2b-256 1527a83af69ae88fa840afa1c640f53680a71034d20bf971e6d01d55ccb014bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for socials-0.3.0-py3-none-any.whl:

Publisher: release.yml on lorey/socials

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page