Skip to main content

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

Metadata

Release files for social-card 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for social-card 0.2.1
File Size Uploaded
social_card-0.2.1.tar.gz 12.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for social-card 0.2.1
File Interpreter ABI Platform
social_card-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 kB

Release files / social_card-0.2.1.tar.gz

Download URL social_card-0.2.1.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e979c8d743039d6c358beb2b3e10647c539a6654bcad9ac1a58f1b10b36dbe8c
BLAKE2b-256 checksum
How to use checksums
d8b98aafc5e6d25cd1c95f54828004cd72df895219a443de89d49f0f720412e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Release files / social_card-0.2.1-py3-none-any.whl

Download URL social_card-0.2.1-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9cbe7fa914a1e6f676bf0db1042a768c4dbfb28ccc6243cc4c2c088d727e65c1
BLAKE2b-256 checksum
How to use checksums
9db46aa7b0379df17be976d0c377036cd228cafdce2bf8df4b3700cd45258ab3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page