An automated daily reader of Thucydides' History of the Peloponnesian War with AI-enhanced educational content, published to thucydides.caseyjr.org.
This project transforms the Crawley translation of Thucydides' history into a ~515-day educational journey, with each day featuring:
- A passage of 2500 characters (~350-500 words)
- Modern translation (sophisticated prose)
- Historical context
- Scholarly annotations with links
- Parallel accounts from other ancient historians
- Related passages within Thucydides
- Discussion prompts
- Reading progress tracking
thucydides/
├── src/ # Source code
│ ├── parser.py # Text parsing into chunks
│ ├── enricher.py # AI content generation
│ ├── publisher.py # Bear Blog API integration
│ └── utils.py # Helper functions
├── data/
│ ├── raw/ # Original Gutenberg text
│ ├── processed/ # Parsed chunks (JSON)
│ └── published/ # Publication tracking
├── scripts/
│ ├── setup.sh # Initial setup script
│ ├── process_text.py # One-time text processing
│ └── daily_post.py # Daily posting script
├── .github/workflows/
│ └── daily-post.yml # GitHub Actions automation
├── requirements.txt # Python dependencies
├── config.yaml # Configuration file
└── README.md
- Python 3.9+
- Anthropic API key (Claude Pro)
- Bear Blog API key
- GitHub account (for automation)
git clone https://github.com/miguelito4/thucydides.git
cd thucydides
pip install -r requirements.txtCreate a .env file with your credentials:
ANTHROPIC_API_KEY=your_anthropic_key
BEAR_BLOG_API_KEY=your_bear_blog_key
BEAR_BLOG_ID=your_blog_id
Download and process Thucydides' text:
python scripts/process_text.pyThis will:
- Download the Crawley translation from Project Gutenberg
- Parse it into 2500-character chunks
- Generate AI-enhanced content for each chunk
- Save everything to
data/processed/
Test a single post:
python scripts/daily_post.py --testThe GitHub Action will automatically post one passage per day at 6:00 AM UTC.
Set repository secrets:
ANTHROPIC_API_KEYBEAR_BLOG_API_KEYBEAR_BLOG_ID
The parser divides Thucydides into ~515 logical chunks, respecting:
- Natural paragraph breaks
- Book/chapter divisions
- Narrative flow
- 2500-character target length
For each passage, Claude generates:
- Modern Translation: Sophisticated prose matching the Warner translation style
- Historical Context: What's happening in the narrative
- Annotations: Links to scholarly analyses and resources
- Parallel Accounts: Related passages from Herodotus, Plutarch, Xenophon
- Internal References: Related sections within Thucydides
- Discussion Prompts: Thoughtful questions for reflection
- Progress Tracking: Current position in the overall work
GitHub Actions runs daily to:
- Load the next unpublished passage
- Format it for Bear Blog
- Publish via Bear Blog API
- Track publication status
# Process a single chunk for testing
python src/parser.py --test-chunk 10
# Regenerate enrichment for a specific chunk
python src/enricher.py --chunk-id 42 --regenerate
# Publish a specific chunk
python src/publisher.py --chunk-id 100Edit config.yaml to customize:
- Chunk size parameters
- AI prompts and templates
- Publishing schedule
- Blog post formatting
Posts are formatted as Markdown with:
- Title: "Day X: [Book and Chapter]"
- Publication date scheduled sequentially
- Tags: thucydides, ancient-greece, history
- Custom CSS for styling (if needed)
The original text is in the public domain. AI-generated enhancements are released under MIT License.
- Crawley translation from Project Gutenberg
- Bear Blog for hosting
- Anthropic Claude for AI enhancements