An advanced Python application that generates comprehensive, structured blog posts using OpenAI's GPT-4o model. This project goes far beyond a basic text generator by creating complete blog posts with proper structure, SEO optimization, and image prompts.
- Intelligent Blog Structure Planning: Automatically generates a complete blog outline with appropriate sections
- SEO Optimization: Includes keyword generation and meta descriptions
- Multi-Section Generation: Creates cohesive content across all blog sections
- Custom User Preferences: Customize target audience and writing tone
- Image Prompt Suggestions: Generates AI image prompts to complement your blog
- Export Options: Saves blogs as Markdown and HTML files with proper formatting
- Rich Console Interface: Visually appealing CLI experience with progress indicators
-
Clone this repository:
git clone https://github.com/metimol/blog_generator.git cd blog_generator
-
Install the required packages:
pip install -r requirements.txt
-
Create a
.env
file in the project directory and add your OpenAI API key:OPENAI_API_KEY=your_openai_api_key_here
Run the program with:
python blog_generator.py
Optional arguments:
--model
: Specify a different OpenAI model (default is "gpt-4o")python blog_generator.py --model gpt-3.5-turbo
-
Blog Structure Planning:
- The program first generates a comprehensive blog structure based on your topic
- Creates a title, sections with descriptions, and SEO keywords
-
User Customization:
- Select your target audience and writing tone
- Review and confirm the blog structure before proceeding
-
Content Generation:
- The program generates detailed content for each section
- Ensures cohesion between sections and appropriate transitions
- Creates a complete blog with proper Markdown formatting
-
Image Suggestions:
- Generates image prompts that complement your blog content
- Includes suggested image styles and section placement
-
Export Options:
- Saves the blog as both Markdown and HTML
- Includes proper metadata and styling
The Advanced Blog Generator uses OpenAI's GPT-4o model to generate all content. The program includes:
- Proper API error handling and retry logic
- JSON parsing for structured content
- Rich console interface with progress indicators
- Clean file exports with metadata
- Python 3.7 or higher
- An OpenAI API key with access to the GPT-4o model
- Internet connectivity for API access
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI for providing the GPT-4o API
- The Rich library for the beautiful console interface