Skip to content

scbcn/cover-maker

 
 

Repository files navigation

SCBCN Speaker Card Generator

Automated pipeline for generating conference speaker cards by dynamically fetching data from the C4P REST API, applying hexagonal cropping with drop shadows to speaker avatars, and compositing them onto multiple custom templates.

Features

  • REST API Integration: Dynamically fetches confirmed sessions directly from the C4P REST API.
  • Hexagonal Cropping: Distinctive hexagonal avatar styling with drop shadows.
  • Multi-Template Support: Handles single and dual speaker sessions across multiple design variations (v1/v2).
  • Google Drive Integration: Optional upload of generated cards to a shared Google Drive folder.
  • CI/CD: Daily automated runs via GitHub Actions for always-up-to-date speaker cards.

Prerequisites

  • Python 3.11+
  • uv (recommended for dependency management)

Setup

  1. Install dependencies:

    uv sync
  2. Configure Environment:

    Copy .env.example to .env and fill in your credentials:

    • C4P_API_URL: The endpoint URL to fetch the submissions from.
    • C4P_API_TOKEN: Your Authorization Token for the C4P API.
    • GDRIVE_CREDENTIALS_PATH: (Optional) Path to your Google Service Account JSON key.
    • GDRIVE_FOLDER_ID: (Optional) Target Google Drive folder ID.
  3. Assets:

    Ensure your assets/ directory contains:

    • Template images (e.g., v1_1_Speaker.jpg, v1_2_Speakers.jpg, etc.).
    • .ttf fonts used for rendering text.

Usage

Local Generation

Generate cards locally into the output/ folder:

uv run python src/generate_cards.py

Local Generation with Upload

Fetch data, generate cards, and push them to Google Drive:

uv run python src/generate_cards.py --upload

Automation

The project includes a GitHub Actions workflow in .github/workflows/generate-cards.yml that runs daily at 06:00 UTC.

To use it, set the following secrets in your GitHub repository:

  • C4P_API_URL
  • C4P_API_TOKEN
  • GDRIVE_CREDENTIALS_JSON (the full content of your Service Account JSON)
  • GDRIVE_FOLDER_ID

Testing

Run the suite with coverage:

PYTHONPATH=src uv run pytest tests/ -v

About

A Python application retrieving the list of confirmed speakers and generating their cover images for social media.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%