Major refactoring to create a unified, self-contained Python package: ### Architecture Changes: - Removed scripts/ directory completely - All functionality now in src/seo/ package - Single entry point: ./seo (imports from src/seo/cli) - No external dependencies on scripts folder ### New Package Structure: src/seo/ ├── __init__.py - Package exports (SEOApp, PostExporter, etc.) ├── cli.py - Command-line interface ├── app.py - Main application class ├── config.py - Configuration management ├── exporter.py - Post export functionality (self-contained) ├── analyzer.py - Enhanced analyzer with selective fields ├── category_proposer.py - AI category proposals (self-contained) ├── seo_checker.py - Placeholder for future implementation ├── categories.py - Placeholder for future implementation ├── approval.py - Placeholder for future implementation └── recategorizer.py - Placeholder for future implementation ### Features: - All modules are self-contained (no scripts dependencies) - EnhancedPostAnalyzer with selective field analysis - CategoryProposer for AI-powered category suggestions - Support for in-place CSV updates with backups - Clean, integrated codebase ### CLI Commands: - seo export - Export posts from WordPress - seo analyze - Analyze with AI (supports -f fields, -u update) - seo category_propose - Propose categories - seo status - Show output files - seo help - Show help ### Usage Examples: ./seo export ./seo analyze -f title categories ./seo analyze -u -f meta_description ./seo category_propose ./seo status ### Benefits: - Single source of truth - Easier to maintain and extend - Proper Python package structure - Can be installed with pip install -e . - Clean imports throughout - No path resolution issues Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
19 lines
337 B
Python
Executable File
19 lines
337 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""
|
|
SEO Automation CLI - Main executable
|
|
Single entry point for SEO automation tool.
|
|
"""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
# Add src to path
|
|
src_dir = Path(__file__).parent / 'src'
|
|
sys.path.insert(0, str(src_dir))
|
|
|
|
# Import and run CLI
|
|
from seo.cli import main
|
|
|
|
if __name__ == '__main__':
|
|
sys.exit(main())
|