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.
- 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.
- Python 3.11+
- uv (recommended for dependency management)
-
Install dependencies:
uv sync
-
Configure Environment:
Copy
.env.exampleto.envand 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.
-
Assets:
Ensure your
assets/directory contains:- Template images (e.g.,
v1_1_Speaker.jpg,v1_2_Speakers.jpg, etc.). .ttffonts used for rendering text.
- Template images (e.g.,
Generate cards locally into the output/ folder:
uv run python src/generate_cards.pyFetch data, generate cards, and push them to Google Drive:
uv run python src/generate_cards.py --uploadThe 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_URLC4P_API_TOKENGDRIVE_CREDENTIALS_JSON(the full content of your Service Account JSON)GDRIVE_FOLDER_ID
Run the suite with coverage:
PYTHONPATH=src uv run pytest tests/ -v