A comprehensive system for extracting, processing, and analyzing scenarios from the Era of the Imperial Republic (EOTIR) RPG forums. The system organizes extracted content into structured formats and can prepare data for LLM training.
β Fully Functional & Production Ready
- 279 scenarios extracted from 3 EOTIR forums
- 93 combined reports generated
- 8 index files created (Excel, JSON, HTML dashboard, timelines)
- All critical bugs fixed (infinite loop, duplicate detection working)
- Comprehensive documentation included
- Fixed infinite pagination loop with proper duplicate detection
- Added real-time progress visibility during extraction
- Fixed Palace Situation Room forum URL
- Generated complete extraction from all forums (97 topics total)
- Created combined reports for all scenarios
- Blue Scenario: 23 topics, 110 files
- Red Scenario: 7 topics, 30 files
- Palace Situation Room: 67 topics, 325 files
- Total Output: 377 markdown files, 93 YAML metadata files
run_manager.bat run-all./run_manager.sh run-allpython main.py run-allThe system provides a complete pipeline for:
- Extraction - Scrape scenario data from EOTIR forums (Red Scenario, Palace Situation Room, Blue Scenario)
- Processing - Analyze scenarios to extract characters, timelines, and plot information
- Indexing - Generate searchable indexes, reports, and an HTML dashboard
- LLM Preparation - Prepare extracted data for LLM training datasets
forum-extractor/
βββ main.py # Main entry point
βββ scenario_manager.py # Pipeline coordinator
βββ run_manager.bat/.sh # Cross-platform runner scripts
β
βββ # Core Modules
βββ forum_scraper.py # Forum scraping with rate limiting
βββ scenario_scraper.py # Scenario extraction wrapper
βββ scenario_processor.py # NLP processing and analysis
βββ scenario_indexer.py # Index and report generation
β
βββ # Utilities
βββ generate_combined_report.py # Combined report generator
βββ update_scenario_status.py # Scenario status management
βββ inspect_page.py # HTML structure inspector
β
βββ # LLM Tools
βββ extract_llm_data.py # Extract data for LLM training
βββ prepare_llm_dataset.py # Prepare character datasets
βββ test_llm_dir.py # Verify LLM directory structure
β
βββ # Demo & Testing
βββ demo.py # Demo with sample scenario
βββ quick_run.py # Quick extraction test
βββ test_extraction.py # Extraction tests
βββ test_runner.py # Full test suite
β
βββ # Output Directories (generated)
βββ Scenarios/ # Extracted scenario data
β βββ Red_Scenario/
β βββ Palace_Situation_Room/
β βββ Blue_Scenario/
β βββ Indexes/
βββ Reports/ # Generated reports
βββ LLM/ # LLM training data
The main entry point supports multiple commands:
# Run complete pipeline (extract β process β index)
python main.py run-all
# Extract scenarios from forums
python main.py extract
python main.py extract --forum "https://nexus.eotir.com/forum/59-red-scenario/"
# Process extracted scenarios
python main.py process
python main.py process --scenario path/to/scenario.md
# Generate indexes and reports
python main.py index
python main.py index --no-excel --no-dashboardpython forum_scraper.pyExtracts all scenarios from configured forums with:
- Automatic rate limiting
- Retry logic for failed requests
- Post content extraction and markdown conversion
# All scenarios
python generate_combined_report.py
# Specific forum
python generate_combined_report.py --forum Red_Scenario
# Specific scenario
python generate_combined_report.py --scenario scenario_folder_name# List all scenarios with status
python update_scenario_status.py --list
# Update scenario status
python update_scenario_status.py --forum Red_Scenario --scenario scenario_name --status "Complete"# Extract data for LLM training (prompts for directory)
python extract_llm_data.py
# With command line argument
python extract_llm_data.py --base-dir /path/to/eotir/data# Run demo with sample scenario
python demo.py
# Run and cleanup after
python demo.py --cleanupEach extracted scenario includes:
content.md- Full scenario content in markdowndramatis_personae.md- Identified characterstimeline.md- Chronological event timelineplot_development.md- Suggestions for continuationmetadata.yaml- Scenario metadata (title, year, status, URL)
scenario_index.xlsx- Excel spreadsheet of all scenariosdashboard.html- Interactive HTML dashboardchronological_timeline.md- Timeline across all scenariosdashboard_data.json- JSON data for dashboard
Install dependencies:
pip install -r requirements.txtRequired packages:
- beautifulsoup4 - HTML parsing
- requests - HTTP requests
- pandas - Data manipulation
- pyyaml - YAML processing
- markdownify - HTML to markdown
- openpyxl - Excel file generation
- tqdm - Progress bars
- nltk, spacy - NLP processing (optional)
Edit forum_scraper.py to modify target forums:
FORUM_URLS = {
"Red_Scenario": "/forum/59-red-scenario/",
"Palace_Situation_Room": "/forum/6-palace-situation-room/",
"Blue_Scenario": "/forum/69-blue-scenario/"
}The scraper includes automatic rate limiting. Adjust in forum_scraper.py:
self.requests_per_minute = 30 # Requests per minute limit| Document | Description |
|---|---|
| CONTRIBUTING.md | Code conventions, commit guidelines, and contribution standards |
| DEVELOPMENT.md | Setup instructions, environment variables, and running locally |
| docs/README.md | Categorized index of all documentation |
# All tests
python test_runner.py
# Specific test suites
python test_runner.py --scraper-only
python test_runner.py --processor-only
python test_runner.py --indexer-only- Uses
pyproject.tomlfor package configuration - Python 3.11+ required
- Cross-platform support (Windows, Linux, macOS)
This project is for personal use with the EOTIR RPG community.