Python tools for generating a PDF art catalog and social media images from the Essential Artists Dayton Wix CMS.
| Script / App | Purpose |
|---|---|
main.py |
Generate the PDF catalog (ArtistCatalog.pdf) |
extract_text.py |
Pull artist bios and statements out of Artists.csv into text files |
generate_summaries.py |
Use Claude (or a local Ollama model) to write short social media summaries |
social/social.py |
Render Instagram and Facebook images for all artists (or one by name) |
process_artist_url.py |
Generate images for a single artist directly from their website URL |
app.py |
Web app — artists self-serve their own social images |
Requires Python 3.11 and a virtual environment:
python3.11 -m venv env
source env/bin/activate
pip install -r requirements.txtSet your Anthropic API key (required for summary generation):
export ANTHROPIC_API_KEY=sk-ant-...The simplest way for artists to generate their own images. Run locally:
source env/bin/activate
python app.pyThen open http://localhost:5000. Enter an artist page URL (e.g. https://www.essentialartistsdayton.org/artist/amy-kollar-anderson), review and edit the description, and download Instagram and Facebook images.
For production deployment see Deployment below.
Run these steps after exporting a fresh Artists.csv from Wix CMS:
source env/bin/activate
# 1. Extract bios and statements from CSV into text files
python extract_text.py
# 2. Generate AI summaries for any artists that don't have one yet
python generate_summaries.py
# 3a. Generate social images for all artists
python social/social.py
# 3b. Or generate for a single artist
python social/social.py "Artist Name"Social images are written to social/output/<Artist_Name>/instagram.png and facebook.png.
source env/bin/activate
python main.pyOutputs ArtistCatalog.pdf.
Process one new artist directly from their website without a CSV export:
source env/bin/activate
python process_artist_url.py https://www.essentialartistsdayton.org/artist/artist-sluggenerate_summaries.py is incremental — it skips artists that already have summaries.
# Use Claude (default)
python generate_summaries.py
# Use a local Ollama model
python generate_summaries.py --provider ollama
python generate_summaries.py --provider ollama --model llama3.2The web app (app.py) is configured for Render via Procfile.
- Push this repo to GitHub.
- Create a new Web Service on Render pointed at the repo.
- Set the environment variable
ANTHROPIC_API_KEYin Render's dashboard. - Render will run
gunicorn app:appautomatically.
The app checks text/artist_summaries.json for existing summaries before calling the Claude API, so artists who've already been processed get instant results.
lib/
artists.py CSV parsing and image URL extraction
images.py Image download, caching, EXIF rotation
text.py Bio/statement loading, summary loading
wix.py Wix image URL → CDN URL
social/
social.py Social image renderer
output/ Generated images (gitignored)
templates/
index.html Web app UI
text/
bios/ Per-artist bio text files
statements/ Per-artist statement text files
all_texts.txt Combined text file for summary generation
artist_summaries.json AI-generated summaries (short / medium / long)
image_cache/ Downloaded image cache (gitignored)