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:| Pass | What happens |
|---|---|
| 0 | Fetch existing blog titles from Supabase (auto-runs before Pass 1) |
| 1 | Identify topics — avoids duplicating existing posts |
| 2 | Plan blog structure per topic (comparison / technical / case-study / how-to) |
| 3 | Generate full content for each blog |
| 4 | Humanise — strip AI tells, vary sentence length, add real-world examples |
| 5 | Add internal links across the batch and reference relevant product pages |
| 6 | Push to Supabase DB with metadata (cover image, tags, SEO keywords, platform) |
_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 | Description | Example use |
|---|---|---|
comparison | A vs B — compares two tools, platforms, or approaches | ”Base44 vs Lovable: Which is better for…” |
technical-deep-dive | In-depth tutorial or explanation | ”How two-way GitHub sync works under the hood” |
case-study | Real-world scenario with outcomes | ”How we deployed 50 no-code apps to AWS in a weekend” |
how-to | Step-by-step guide | ”How to add Stripe payments to your Lovable app” |
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.