A Python tool that generates themed addon packs for the popular party game "Cards Against Humanity" using Google's Gemini AI model.
This project uses Google's Gemini AI to create custom Cards Against Humanity addon packs based on specified topics. It generates both black cards (prompts with blanks) and white cards (responses or answers).
- Generate themed Cards Against Humanity card packs
- Customizable topic selection
- Outputs card packs in JSON format
- Automatically timestamps generated files
- Python 3.11+
- Google Gemini API key
-
Clone the repository:
git clone https://github.com/darkflib/CAH-addon-gen.git cd CAH-addon-gen -
Create a virtual environment and activate it:
uv venv . .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies:
uv pip install -r requirements.txt
-
Create a
.envfile in the project root with your Google Gemini API key:GEMINI_API_KEY=your_api_key_here
Run the script from the command line:
python CAH-gen.pyBy default, this will generate a "Site Reliability Engineering (SRE) and DevOps" themed pack with:
- 20 black cards (prompts)
- 40 white cards (responses)
The generated pack will be saved as a JSON file with a timestamp in the format: CAH_[topic]-[timestamp].json
To generate a pack with a different theme, modify the topic variable in the script or adapt the code to accept command-line arguments.
The generated JSON file has the following structure:
{
"black": [
"When the production server goes down, I always blame ____.",
"Our CI/CD pipeline would be perfect if it weren't for ____.",
...
],
"white": [
"Turning it off and on again.",
"A mysterious CPU spike at 3 AM.",
...
]
}MIT
Mike (darkflib@gmail.com)