Generate chess puzzle videos from Lichess daily puzzles. This is Milestone 1 - local video generation only, no YouTube upload functionality.
- Fetch daily puzzle from Lichess API
- Normalize puzzle data (FEN, solution moves, themes)
- Render chess board frames with move animations
- Generate silent MP4 video (1920x1080, 30fps)
- Save structured metadata and artifacts
- Python 3.11+
- FFmpeg (for video generation)
- Create and activate virtual environment:
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate- Install package with dependencies:
pip install -e .[dev]- Verify installation:
python -m src.main smoke-testpython -m src.main smoke-testThis checks for:
- Python packages (requests, python-chess, Pillow, cairosvg)
- FFmpeg availability
- Configuration file
python -m src.main run --skip-uploadThis will:
- Fetch the daily puzzle from Lichess
- Normalize puzzle data
- Render board frames
- Build MP4 video
- Generate metadata
To regenerate a video even if it already exists:
python -m src.main run --skip-upload --forceArtifacts are saved to artifacts/YYYY-MM-DD/:
artifacts/2026-04-15/
├── puzzle.json # Raw puzzle data from Lichess
├── metadata.json # Run metadata and puzzle info
├── video.mp4 # Generated video (1920x1080, 30fps)
├── frames/ # Individual PNG frames
│ ├── frame_00000.png
│ ├── frame_00001.png
│ └── ...
└── .state/ # Run state markers (internal)
Edit config/app.json to customize:
- Video settings: Resolution, FPS, codec
- Render settings: Board size, frame durations
- Paths: Artifacts directory, FFmpeg path
This implementation includes only local video generation:
✅ Included:
- Lichess API integration
- Board rendering with python-chess
- Video generation with FFmpeg
- Local artifact storage
❌ Not included (future milestones):
- YouTube API integration
- OAuth authentication
- Upload automation
- Scheduling
A test script is provided to verify the pipeline with sample data:
python test_pipeline.pyThis tests all pipeline stages with a sample puzzle and verifies artifacts are created correctly.
.
├── config/
│ └── app.json # Application configuration
├── src/
│ ├── __init__.py
│ ├── main.py # CLI orchestrator
│ ├── fetch_puzzle.py # Lichess API client
│ ├── puzzle_model.py # Data normalization
│ ├── render_board.py # Board frame rendering
│ ├── build_video.py # FFmpeg video builder
│ ├── metadata.py # Metadata generation
│ └── state_manager.py # Run state tracking
├── test_data/
│ └── sample_puzzle.json # Sample puzzle for testing
├── test_pipeline.py # Pipeline test script
├── pyproject.toml # Package configuration
└── README.md # This file
This project is for educational and personal use.