import streamlit as st from loguru import logger # Import existing tools from lib.ai_seo_tools.seo_structured_data import ai_structured_data from lib.ai_seo_tools.content_title_generator import ai_title_generator from lib.ai_seo_tools.meta_desc_generator import metadesc_generator_main from lib.ai_seo_tools.image_alt_text_generator import alt_text_gen from lib.ai_seo_tools.opengraph_generator import og_tag_generator from lib.ai_seo_tools.optimize_images_for_upload import main_img_optimizer from lib.ai_seo_tools.google_pagespeed_insights import google_pagespeed_insights from lib.ai_seo_tools.on_page_seo_analyzer import analyze_onpage_seo from lib.ai_seo_tools.weburl_seo_checker import url_seo_checker from lib.ai_marketing_tools.ai_backlinker.backlinking_ui_streamlit import backlinking_ui from lib.ai_seo_tools.content_gap_analysis.ui import ContentGapAnalysisUI from lib.ai_seo_tools.content_gap_analysis.enhanced_ui import render_enhanced_content_gap_analysis from lib.ai_seo_tools.content_calendar.ui.dashboard import ContentCalendarDashboard from lib.ai_seo_tools.technical_seo_crawler import render_technical_seo_crawler # Import additional tools from lib.ai_seo_tools.twitter_tags_generator import display_app as twitter_tags_app from lib.ai_seo_tools.sitemap_analysis import main as sitemap_analyzer from lib.ai_seo_tools.textstaty import analyze_text as readability_analyzer from lib.ai_seo_tools.wordcloud import generate_wordcloud from lib.alwrity_ui.dashboard_styles import apply_dashboard_style, render_dashboard_header, render_category_header, render_card def render_content_gap_analysis(): """Render the content gap analysis workflow interface.""" from lib.ai_seo_tools.content_gap_analysis.ui import ContentGapAnalysisUI # Initialize and run the Content Gap Analysis UI ui = ContentGapAnalysisUI() ui.run() def render_enhanced_content_gap_analysis_ui(): """Render the enhanced content gap analysis with advertools integration.""" render_enhanced_content_gap_analysis() def render_content_calendar(): """Render the content calendar dashboard.""" import logging import sys from datetime import datetime # Configure logging logging.basicConfig( level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', handlers=[ logging.StreamHandler(sys.stdout), logging.FileHandler('content_calendar.log', mode='a') ] ) logger = logging.getLogger('content_calendar') try: logger.info("Initializing Content Calendar Dashboard") dashboard = ContentCalendarDashboard() logger.info("Rendering Content Calendar Dashboard") dashboard.render() logger.info("Content Calendar Dashboard rendered successfully") except Exception as e: logger.error(f"Error rendering content calendar: {str(e)}", exc_info=True) st.error(f"An error occurred while loading the content calendar: {str(e)}") def render_twitter_tags(): """Render the Twitter tags generator.""" twitter_tags_app() def render_readability_analyzer(): """Render the text readability analyzer.""" st.title("π Text Readability Analyzer") st.write("Making Your Content Easy to Read") text_input = st.text_area("Paste your text here:", height=200) if st.button("Analyze Readability"): if text_input.strip(): from textstat import textstat # Calculate various metrics metrics = { "Flesch Reading Ease": textstat.flesch_reading_ease(text_input), "Flesch-Kincaid Grade Level": textstat.flesch_kincaid_grade(text_input), "Gunning Fog Index": textstat.gunning_fog(text_input), "SMOG Index": textstat.smog_index(text_input), "Automated Readability Index": textstat.automated_readability_index(text_input), "Coleman-Liau Index": textstat.coleman_liau_index(text_input), "Linsear Write Formula": textstat.linsear_write_formula(text_input), "Dale-Chall Readability Score": textstat.dale_chall_readability_score(text_input), "Readability Consensus": textstat.readability_consensus(text_input) } # Display metrics st.subheader("Text Analysis Results") for metric, value in metrics.items(): st.metric(metric, f"{value:.2f}") # Add recommendations st.subheader("Key Takeaways:") st.markdown(""" * **Don't Be Afraid to Simplify!** Often, simpler language makes content more impactful and easier to digest. * **Aim for a Reading Level Appropriate for Your Audience:** Consider the education level, background, and familiarity of your readers. * **Use Short Sentences:** This makes your content more scannable and easier to read. * **Write for Everyone:** Accessibility should always be a priority. When in doubt, aim for clear, concise language! """) else: st.error("Please enter text to analyze.") def render_wordcloud_generator(): """Render the word cloud generator.""" st.title("βοΈ Word Cloud Generator") st.write("Visualize the most important words in your content") text_input = st.text_area("Enter your text:", height=200) if st.button("Generate Word Cloud"): if text_input.strip(): from wordcloud import WordCloud import matplotlib.pyplot as plt # Create and generate a word cloud image wordcloud = WordCloud(width=800, height=400, background_color='white').generate(text_input) # Display the word cloud st.subheader("Word Cloud Visualization") fig, ax = plt.subplots(figsize=(10, 5)) ax.imshow(wordcloud, interpolation='bilinear') ax.axis('off') st.pyplot(fig) # Add some statistics st.subheader("Text Statistics") words = text_input.split() unique_words = set(words) st.metric("Total Words", len(words)) st.metric("Unique Words", len(unique_words)) else: st.error("Please enter text to generate a word cloud.") def render_seo_tools_dashboard(): """Render a modern dashboard for SEO tools with premium glassmorphic design.""" # Apply common dashboard styling apply_dashboard_style() # Enhanced dashboard header with modern design render_dashboard_header( "π SEO AI Power Suite", "Dominate search rankings with our comprehensive AI-powered SEO toolkit. From keyword research to content optimization, master every aspect of search engine optimization." ) # Define SEO tools organized by real use cases and existing functionality seo_tools = { "Content Creation & Optimization": { "Content Title Generator": { "icon": "π", "description": "Create attention-grabbing, SEO-optimized titles that resonate with your audience", "category": "Content", "path": "blog_title", "features": ["Keyword Optimization", "Title Variations", "CTR Enhancement", "SEO Best Practices"] }, "Meta Description Generator": { "icon": "π·οΈ", "description": "Generate compelling meta descriptions that boost click-through rates from search results", "category": "Meta Tags", "path": "meta_description", "features": ["SERP Optimization", "Character Limits", "Keyword Integration", "CTR Improvement"] }, "Structured Data Generator": { "icon": "ποΈ", "description": "Create schema markup to enhance search result appearance with rich snippets", "category": "Technical", "path": "structured_data", "features": ["Rich Snippets", "Schema Markup", "Search Enhancement", "SERP Features"] } }, "Image & Media Optimization": { "Image Alt Text Generator": { "icon": "πΌοΈ", "description": "Generate SEO-friendly alt text for images to improve accessibility and search visibility", "category": "Images", "path": "alt_text", "features": ["Accessibility", "Image SEO", "Screen Reader Support", "Search Discovery"] }, "Image Optimizer": { "icon": "π―", "description": "Optimize images for web performance and faster loading times", "category": "Performance", "path": "image_optimizer", "features": ["File Compression", "Format Optimization", "Performance Boost", "Web Standards"] } }, "Social Media Optimization": { "OpenGraph Generator": { "icon": "π±", "description": "Create OpenGraph tags for beautiful social media sharing experiences", "category": "Social", "path": "opengraph", "features": ["Social Sharing", "Visual Appeal", "Engagement Boost", "Platform Optimization"] }, "Twitter Tags Generator": { "icon": "π¦", "description": "Generate trending and relevant Twitter hashtags for maximum engagement", "category": "Social", "path": "twitter_tags", "features": ["Hashtag Research", "Trend Analysis", "Engagement Boost", "Content Discovery"] } }, "Technical SEO Analysis": { "Technical SEO Crawler": { "icon": "π§", "description": "Comprehensive site-wide technical SEO analysis with AI-powered recommendations. Identify and fix technical issues that impact your search rankings.", "category": "Technical", "path": "technical_seo_crawler", "features": ["Site-wide Crawling", "Technical Issues Detection", "Performance Analysis", "AI Recommendations"] }, "On-Page SEO Analyzer": { "icon": "π", "description": "Comprehensive analysis of on-page SEO factors with actionable recommendations", "category": "Analysis", "path": "onpage_seo", "features": ["Content Analysis", "SEO Scoring", "Recommendations", "Best Practices"] }, "Website Speed Insights": { "icon": "β‘", "description": "Analyze website performance using Google PageSpeed Insights", "category": "Performance", "path": "pagespeed", "features": ["Core Web Vitals", "Performance Metrics", "Optimization Tips", "Mobile Analysis"] }, "URL SEO Checker": { "icon": "π", "description": "Analyze URL structure and SEO factors for better search rankings", "category": "Technical", "path": "url_checker", "features": ["URL Analysis", "SEO Factors", "Technical Issues", "Optimization Tips"] }, "Sitemap Analyzer": { "icon": "πΊοΈ", "description": "Analyze website sitemaps to understand content structure and publishing trends", "category": "Technical", "path": "sitemap_analysis", "features": ["Content Structure", "Publishing Trends", "URL Analysis", "Site Architecture"] } }, "Content Analysis & Research": { "Content Gap Analysis": { "icon": "π", "description": "Identify content opportunities and gaps in your SEO strategy", "category": "Research", "path": "content_gap_analysis", "features": ["Competitor Analysis", "Keyword Gaps", "Content Opportunities", "Strategic Insights"] }, "Enhanced Content Gap Analysis": { "icon": "π―", "description": "Advanced content gap analysis with SERP intelligence, competitor crawling, and AI insights using advertools", "category": "Research", "path": "enhanced_content_gap_analysis", "features": ["SERP Analysis", "Competitor Intelligence", "Keyword Expansion", "AI Strategic Insights"] }, "Text Readability Analyzer": { "icon": "π", "description": "Analyze text readability and get suggestions for content improvement", "category": "Content", "path": "readability_analyzer", "features": ["Reading Level", "Clarity Score", "Improvement Tips", "Audience Targeting"] }, "Word Cloud Generator": { "icon": "βοΈ", "description": "Visualize the most important words and terms in your content", "category": "Visualization", "path": "wordcloud_generator", "features": ["Content Visualization", "Keyword Analysis", "Theme Identification", "Text Statistics"] } }, "Strategy & Planning": { "Content Calendar": { "icon": "π ", "description": "Plan and organize your content strategy with AI-powered scheduling", "category": "Planning", "path": "content_calendar", "features": ["Content Planning", "Publishing Schedule", "Strategy Management", "Team Collaboration"] }, "Backlink Analysis": { "icon": "π", "description": "Analyze backlink opportunities and develop link building strategies", "category": "Link Building", "path": "backlinking", "features": ["Link Analysis", "Opportunity Discovery", "Authority Building", "Outreach Planning"] } } } # Render categories and tools for category, tools in seo_tools.items(): # Render category header render_category_header(category) # Create responsive grid for tools in this category cols = st.columns(3) for idx, (tool_name, details) in enumerate(tools.items()): with cols[idx % 3]: # Use the common card renderer if render_card( icon=details['icon'], title=tool_name, description=details['description'], category=details['category'], key_suffix=f"seo_{tool_name.replace(' ', '_')}", help_text=f"Open {tool_name} - {details['description'][:50]}..." ): # Set query parameters to redirect to the specific tool st.query_params["tool"] = details["path"] st.rerun() # Add SEO insights section st.markdown("""
Real tools, real results. Each tool is designed to solve specific SEO challenges and drive measurable improvements.