generate_blogs.py is an open source Python script that automates blog content creation end-to-end. It uses a multi-pass pipeline powered by Claude to generate high-quality, humanised blog posts and publish them to your Supabase database.
This script is open source. You can adapt it for your own content pipeline — replace the Supabase publishing step with your CMS of choice.
What it does
The pipeline runs in 6 passes, each building on the last:
Each pass caches its output to local JSON files (
_topics.json, _plans.json, _registry.json) so you can resume from any pass if something fails.
Requirements
- Python 3.9+
- An Anthropic API key (Claude)
- A Supabase project with a
blogstable (for publishing)
json, os, argparse, pathlib, urllib) plus the anthropic package.
Setup
Clone or install from the nometria/blog-pipeline repository:Also available on PyPI: blog-pipeline
Usage
Output
Local files (inblogs/ directory):
_topics.json— topic list with metadata_plans.json— structure plans per topic_registry.json— tracking which blogs exist locally vs in DB<slug>.md— one markdown file per generated blog
blogs table with:
Blog types
The pipeline generates three blog formats:
Type is determined by Claude in Pass 2 based on topic suitability.
Customising for your project
Change the niche/focus: Edit the system prompt ingenerate_blogs.py around the CATEGORY_MAP and topic generation sections. Replace references to Nometria and vibe coding with your own product and subject matter.
Change the publishing destination:
Replace the push_to_supabase() function with your own CMS integration. The function receives a dict with slug, title, content, tags, cover_image, etc.
Adjust the cover image pool:
The _COVER_POOL dict maps blog categories to curated Unsplash photo IDs. Add or remove photo IDs to change the visual style of generated posts.