A powerful Python CLI tool that combines traditional SEO analysis with cutting-edge AI to optimize your web content for search engines. Get actionable insights, AI-powered recommendations, and grammar-safe content improvements.
Features β’ Installation β’ Usage β’ AI Features β’ Documentation β’ Contributing
- Overview
- Key Features
- AI-Powered Features
- Installation
- Quick Start
- Usage Examples
- What It Analyzes
- Architecture
- Configuration
- Sample Output
- Documentation
- Roadmap
- Contributing
- License
- Support
SEO Analyzer is an advanced Python CLI tool designed for SEO professionals, content creators, and digital marketers who want to optimize their web content for search engines. It combines traditional SEO analysis with state-of-the-art AI models (Google Gemini & OpenAI GPT-5) to provide intelligent recommendations that boost your search rankings.
- Keyword-Focused Analysis: Target specific keywords with Google-like matching algorithms
- AI-Powered Insights: Get intelligent recommendations from cutting-edge AI models
- Grammar-Safe Optimization: Fix grammar issues without affecting SEO keywords
- Comprehensive Scoring: Evaluate 40+ SEO factors with weighted scoring
- Beautiful CLI Output: Rich terminal interface with colors and progress indicators
- Fast & Efficient: Get complete analysis in seconds
- Export-Ready: JSON output for automation and integration
| Feature | Description |
|---|---|
| Keyword Analysis | Analyzes short-tail and long-tail keywords with intelligent matching |
| Google-like Matching | Smart keyword detection using stemming, variations, and stopword removal |
| Individual & Cluster Scoring | Detailed performance metrics for each keyword and keyword groups |
| Technical SEO | Title tags, meta descriptions, canonical tags, Open Graph validation |
| Content Quality | Keyword density, placement, distribution, and word count analysis |
| Structure Analysis | Heading hierarchy (H1-H6), image alt tags, and content organization |
| Link Analysis | Internal and external link counts with quality assessment |
- NLP-Powered Matching: NLTK-based tokenization, stemming, and semantic analysis
- Weighted Scoring System: Configurable weights for different SEO factors
- Beautiful CLI: Rich terminal output with colors, tables, and panels
- JSON Export: Machine-readable reports for automation
- Verbose Mode: Detailed breakdowns for in-depth analysis
- Fast Analysis: Complete reports in under 10 seconds
Leverage the power of Google Gemini (FREE) or OpenAI GPT-5 for advanced SEO insights:
- Get 5 specific, actionable SEO recommendations
- Keyword-focused suggestions tailored to your target keywords
- Based on current performance scores and content analysis
- Title Tag Generation: SEO-optimized titles (50-60 characters)
- Meta Description Generation: Compelling descriptions (150-160 characters)
- Keyword-integrated, click-worthy, and search-engine friendly
Evaluate your content across multiple dimensions:
- Readability Score (1-10): How easy is your content to read?
- Engagement Potential (1-10): Will readers stay on your page?
- Keyword Stuffing Risk (1-10): Are you over-optimizing?
- Content Value (1-10): Does your content provide real value?
- Keyword Targeting (1-10): How well do you target your keywords?
The most unique feature - improve grammar WITHOUT affecting SEO:
- Grammar Score: Identify grammar issues (1-10 scale)
- SEO-Preserved Fixes: Grammar corrections that keep ALL keywords intact
- Improved Title & Meta: Better versions with keywords preserved
- Readability Tips: Enhance readability without changing keyword density
- Grammar Suggestions: Top 3 fixes that won't hurt your SEO
Why This Matters: Traditional grammar checkers often remove or change keywords, hurting your SEO. Our AI understands SEO and fixes grammar while preserving keyword density and placement.
| Provider | Model | Cost | Recommended For |
|---|---|---|---|
| Google Gemini | gemini-2.5-flash |
FREE | Everyone (default) |
| OpenAI | gpt-5 |
Paid | Advanced users |
- Python 3.8 or higher
- pip (Python package manager)
- Internet connection (for webpage analysis)
git clone https://github.com/cleven12/seo_optimizer.git
cd seo_optimizer# Create virtual environment
python -m venv venv
# Activate virtual environment
# On macOS/Linux:
source venv/bin/activate
# On Windows:
venv\Scripts\activatepip install -r requirements.txtpython -c "import nltk; nltk.download('punkt'); nltk.download('stopwords'); nltk.download('punkt_tab')"For AI-powered recommendations, you need an API key:
- Get a FREE API key: https://aistudio.google.com/apikey
- Set environment variable:
# On macOS/Linux:
export GEMINI_API_KEY="your-api-key-here"
# On Windows:
set GEMINI_API_KEY=your-api-key-here
# Or add to .env file:
echo "GEMINI_API_KEY=your-api-key-here" > .env- Get API key: https://platform.openai.com/api-keys
- Set environment variable:
# On macOS/Linux:
export OPENAI_API_KEY="your-api-key-here"
# On Windows:
set OPENAI_API_KEY=your-api-key-herepython main.py --url "https://example.com" --keywords "seo,optimization,search engine"python main.py --url "https://example.com" --keywords "seo,optimization" --aipython main.py --url "https://example.com" --keywords "python tutorial" --output report.json --aipython main.py --url "https://example.com" --keywords "web development" --verbose --aipython main.py \
--url "https://myblog.com/learn-python" \
--keywords "learn python,python tutorial,python for beginners" \
--ai \
--verbosepython main.py \
--url "https://shop.com/product/123" \
--keywords "buy laptop,gaming laptop,best laptop 2025" \
--output product-seo-report.json \
--aipython main.py \
--url "https://saas.com/landing" \
--keywords "project management software,team collaboration tool" \
--ai#!/bin/bash
URLS=(
"https://example.com/page1"
"https://example.com/page2"
"https://example.com/page3"
)
for URL in "${URLS[@]}"; do
python main.py --url "$URL" --keywords "target keyword" --output "report-$(basename $URL).json" --ai
done
|
|
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CLI Interface Layer β
β (Rich Terminal Output) β
βββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Orchestrator/Controller β
β (Coordinates Analysis Pipeline) β
βββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββΌββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββ ββββββββββββ ββββββββββββ
β Content β β Keyword β β NLP β
β Fetcher β βProcessor β βProcessingβ
ββββββ¬βββββ ββββββ¬ββββββ ββββββ¬ββββββ
β β β
ββββββββββββββββΌββββββββββββββββ
β
ββββββββββββββββΌβββββββββββββββ
β β β
βΌ βΌ βΌ
ββββββββββ βββββββββββ ββββββββββ
βTechnicalβ β Content β βStructureβ
β SEO β βAnalyzer β βAnalyzerβ
ββββββ¬ββββ ββββββ¬βββββ ββββββ¬ββββ
β β β
βββββββββββββββΌβββββββββββββββ
β
βΌ
βββββββββββββββββββ
β AI Analyzer β
β (Gemini/OpenAI) β
ββββββββββ¬ββββββββββ
β
βΌ
βββββββββββββββββββ
β Scoring Engine β
ββββββββββ¬ββββββββββ
β
βΌ
βββββββββββββββββββ
β Output Layer β
β (CLI / JSON) β
βββββββββββββββββββ
| Component | Technology | Purpose |
|---|---|---|
| CLI Interface | Rich, argparse | User input and formatted output |
| Content Fetcher | requests, BeautifulSoup4 | HTML parsing and data extraction |
| Keyword Processor | NLTK | NLP operations (stemming, tokenization) |
| Analysis Modules | Plugin architecture | Modular SEO analyzers |
| AI Analyzer | Google Gemini / OpenAI | AI-powered recommendations |
| Scoring Engine | Custom algorithm | Weighted scoring system |
| Output Layer | Rich / JSON | CLI rendering and export |
Customize analysis behavior by editing src/config.py:
# Keyword Density
OPTIMAL_KEYWORD_DENSITY_MIN = 1.0 # 1%
OPTIMAL_KEYWORD_DENSITY_MAX = 3.0 # 3%
# Title & Meta
OPTIMAL_TITLE_LENGTH_MIN = 50
OPTIMAL_TITLE_LENGTH_MAX = 60
OPTIMAL_META_DESC_LENGTH_MIN = 150
OPTIMAL_META_DESC_LENGTH_MAX = 160
# Content
MIN_WORD_COUNT = 300
# Links
RECOMMENDED_INTERNAL_LINKS_MIN = 3
RECOMMENDED_INTERNAL_LINKS_MAX = 10
# Scoring Weights
KEYWORD_ANALYSIS_WEIGHT = 0.40 # 40%
TECHNICAL_SEO_WEIGHT = 0.20 # 20%
CONTENT_QUALITY_WEIGHT = 0.20 # 20%
STRUCTURE_WEIGHT = 0.10 # 10%
LINK_ANALYSIS_WEIGHT = 0.10 # 10%π Analyzing: https://example.com
Focus Keywords: "python tutorial", "learn python", "python for beginners"
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π SEO ANALYSIS REPORT
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π― OVERALL SEO SCORE: 78/100
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π― Keyword Cluster Performance: 75/100 β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π Individual Keyword Scores:
β
"python tutorial" - 85/100
ββ Title: β Yes
ββ Meta: β Yes
ββ H1: β Yes
ββ Density: 2.1% (optimal)
ββ First 100 words: β Yes
β οΈ "learn python" - 70/100
ββ Title: β No
ββ Meta: β Yes
ββ H1: β Yes
ββ Density: 1.5%
ββ First 100 words: β Yes
π‘ Add "learn python" to title tag
β
"python for beginners" - 80/100
ββ Title: β Yes
ββ Meta: β Yes
ββ H1: β No
ββ Density: 1.8%
ββ First 100 words: β Yes
π‘ Include "python for beginners" in H1 heading
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
Technical SEO: 85/100
β
Content Analysis: 82/100
β
Structure: 75/100
β οΈ Links: 65/100
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π€ AI-POWERED SEO INSIGHTS (Gemini 2.5 Flash)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π AI-Optimized Title:
Learn Python: Complete Tutorial for Beginners in 2025
π AI-Optimized Meta Description:
Master Python programming with our comprehensive tutorial designed for beginners. Learn syntax, projects, and best practices. Start coding today!
π Content Quality Analysis:
ββ Readability: 8/10
ββ Engagement: 9/10
ββ Content Value: 8/10
βοΈ Grammar & Readability (SEO-Safe):
ββ Grammar Score: 7/10
ββ Issues Found: 5
ββ SEO Keywords Preserved: β Yes
Improved Title (Keywords Preserved):
Learn Python: The Complete Tutorial for Beginners
Grammar Fixes:
β’ Fix run-on sentence in paragraph 3 (keywords preserved)
β’ Add comma after introductory phrase
β’ Correct subject-verb agreement in section 2
Readability Tips:
β’ Break long paragraphs into shorter ones
β’ Use more transition words between sections
π‘ AI Recommendations:
1. Add "learn python" to the title tag for better keyword coverage
2. Include more internal links to related Python topics (current: 2, recommended: 5-8)
3. Extend meta description to 155-160 characters for optimal visibility
4. Add "python for beginners" to the H1 heading
5. Increase keyword density for "learn python" to 1.5-2% for better targeting
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π― TOP RECOMMENDATIONS
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1. π΄ Add "learn python" to title tag
2. π΄ Increase internal linking (add 3 more links)
3. π‘ Extend meta description to 155-160 characters
4. π’ Include "python for beginners" in H1 heading
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
Analysis complete! Export with --output to save as JSON
- NOTES.md: Complete technical documentation and architecture details
- DESIGN_ARCHITECTURE_DOCS.md: In-depth design documentation
- API Reference: Detailed API documentation (coming soon)
usage: main.py [-h] -u URL -k KEYWORDS [-o OUTPUT] [-v] [--ai]
SEO Analyzer - AI-Powered Content Optimization Tool
required arguments:
-u, --url URL Target URL to analyze
-k, --keywords KEYWORDS
Comma-separated focus keywords
optional arguments:
-h, --help Show this help message and exit
-o, --output OUTPUT JSON output file path
-v, --verbose Show detailed analysis
--ai Enable AI-powered recommendations (requires API key)| Variable | Description | Required |
|---|---|---|
GEMINI_API_KEY |
Google Gemini API key | For AI features |
OPENAI_API_KEY |
OpenAI API key | Alternative to Gemini |
- Core SEO analysis engine
- Keyword matching with NLP
- Beautiful CLI output
- JSON export functionality
- AI-powered recommendations (Gemini & OpenAI)
- Grammar analysis (SEO-safe)
- Content quality evaluation
- Google Search Console integration
- Competitor comparison analysis
- Historical tracking dashboard
- Semantic similarity with spaCy
- Multi-language support (ES, FR, DE, IT)
- Batch URL analysis
- Web dashboard interface
- WordPress plugin
- Browser extension
- REST API endpoint
- Slack/Discord bot integration
- Page speed metrics
- JavaScript rendering support
- Image SEO analysis
- Schema markup validation
- Backlink analysis
- SERP position tracking
Contributions are what make the open-source community amazing! Any contributions you make are greatly appreciated.
-
Fork the Project
git clone https://github.com/cleven12/seo_optimizer.git
-
Create your Feature Branch
git checkout -b feature/AmazingFeature
-
Commit your Changes
git commit -m 'Add some AmazingFeature' -
Push to the Branch
git push origin feature/AmazingFeature
-
Open a Pull Request
# Clone and setup
git clone https://github.com/cleven12/seo_optimizer.git
cd seo_optimizer
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt # For testing
# Run tests
pytest
# Code formatting
black src/
flake8 src/- Write clear, commented code
- Follow PEP 8 style guide
- Add tests for new features
- Update documentation
- Keep commits focused and atomic
Distributed under the MIT License. See LICENSE file for more information.
MIT License
Copyright (c) 2025 Cleven
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...
- Found a bug? Open an issue
- Have a feature request? Open an issue
- Have a question? Start a discussion
- Need direct support? Email: support@example.com
If you find this project useful, please consider:
- Starring the repository
- Sharing on social media
- Telling your friends
- Buying me a coffee: https://buymeacoffee.com/cleven
- Built with Rich for beautiful CLI output
- NLP powered by NLTK
- HTML parsing with BeautifulSoup4
- AI features by Google Gemini and OpenAI
- Inspired by industry-leading SEO tools
Cleven
- GitHub: @cleven12
- Twitter: @cleven02
- LinkedIn: Cleven12
- Website: Cleven12.dev
Made with β€οΈ by Cleven
β If you find this project useful, please give it a star! β