Skip to main content

Generate beautiful social card images (OG, Twitter, GitHub) with a builder API

Project description

social-card

Generate beautiful social card images with a builder API. One dependency: Pillow.

Built by humanjava.com — find this and other tools for the agentic age at huje.tools.

Install

pip install social-card

Quick Start

from social_card import SocialCard

SocialCard("og").title("My Project").subtitle("A cool tool").render("card.png")

Full Example

(SocialCard("og", theme="midnight")
    .badge("Open Source")
    .title("My Project")
    .subtitle("Deploy in seconds")
    .cards(["Python", "Pillow", "MIT"])
    .footer("myproject.dev")
    .accent("#f97316")
    .grid()
    .glow()
    .render("card.png"))

Presets

Preset Size Use Case
og 1200×630 Open Graph / link previews
twitter 800×418 Twitter/X cards
github 1280×640 GitHub social preview
square 1080×1080 Instagram / social

Themes

  • dark — Navy background, blue accent
  • light — White background, blue accent
  • midnight — Near-black, purple accent

API

card = SocialCard(preset, theme)   # preset: str or Preset, theme: str or Theme
card.badge("text")                 # Small pill at top
card.title("text")                 # Main heading
card.subtitle("text")              # Subheading
card.cards(["a", "b", "c"])        # Tag chips
card.footer("text")                # Bottom text
card.accent("#hex")                # Override accent color
card.grid()                        # Subtle grid overlay
card.glow()                        # Radial glow effect
card.render("path.png")            # Save to file, returns Image
card.render_bytes()                # Returns PNG bytes

ClawHub

clawhub install social-card

License

MIT

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

social_card-0.2.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

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

social_card-0.2.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file social_card-0.2.0.tar.gz.

File metadata

  • Download URL: social_card-0.2.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for social_card-0.2.0.tar.gz
Algorithm Hash digest
SHA256 072ca8e8ea2c9d6039447da44ad2c397777197a6ba5f9e80432c326314cff6f5
MD5 e08d891f431b98baca36b6723927b981
BLAKE2b-256 ec593f4fc39147d4099749b57789c7bfde3b878a93853f3e7e0d92d40fd09ef7

See more details on using hashes here.

File details

Details for the file social_card-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: social_card-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for social_card-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 37d6917bc6e38c582afe9d83a4118fc5211e018edcd748eb4e167da4b0d85679
MD5 0fa0a8fbbe1d7c10323756cdf36532e6
BLAKE2b-256 43844d5bdc65c877296ccb0344282fb47019f61e1b08d05f7101e14047b8da23

See more details on using hashes here.

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