A Eurovision Song Contest (ESC) scoring prediction system that helps calculate the final televoting scores to determine the winner before the last country's points are announced.
This tool helps predict Eurovision Song Contest results by combining jury scores with televoting scores. The main goal is to skip the 20-30 seconds when the last country is about to receive their televoting points.
By entering all but one country's televoting scores, the system calculates what the final country's score must be, instantly revealing the winner without the suspense. It features:
- Interactive score entry with a beautiful terminal UI
- Automatic calculation of the final missing televoting score
- Dramatic pause with spinner animation (because Eurovision needs drama!)
- Winner announcement with celebration
- Interactive CLI: Enter televoting scores one by one with Rich's beautiful interface
- Smart Validation: Prevents negative scores and validates input format
- Backtrack Support: Go back and correct previous entries with 'b'
- Automatic Calculation: Calculates the final country's televoting score based on ESC rules
- Dramatic Presentation: Includes spinner animations and winner announcements
- Comprehensive Testing: Full test suite with historical ESC data
While the main goal of this project is the one described above, it was the occasion for me to learn how to create CLI apps in python (with Typer) and how to create beautiful terminal UIs (with Rich), with an original idea.
- Python 3.12 or higher
- Dependencies are managed via
uv
- Clone the repository:
git clone h
cd esc-drammatic-unpause- Install dependencies using
uv:
uv syncOr using pip:
pip install -e .Run the program with a jury scores file:
python -m srcpython -m src --jury-path your_jury_file.txt --participating-countries 37 --rest-of-world-voteAvailable options:
--jury-path: Path to jury scores file (default:jury.txt)--participating-countries: Number of participating countries (default: 37)--rest-of-world-vote/--no-rest-of-world-vote: Include rest of world televote (default: enabled, introduced in 2023)
Create a text file with jury scores in the following format:
Country Name 123
Another Country 456
Switzerland 789
Each line should contain:
- Country name (can include spaces)
- Score (integer, separated by space)
- The program displays current jury scores
- Enter televoting scores for each country (except the last one)
- Use 'b' to go back and correct previous entries
- Confirm your final entry
- Watch the dramatic pause...
- See the calculated final scores and winner announcement!
The system follows Eurovision scoring rules:
- Jury Scores: Pre-calculated professional jury points
- Televoting Scores: User enters N-1 country scores interactively
- Final Calculation: The last country's televoting score is automatically calculated based on:
- Total available points: (12+10+8+7+6+5+4+3+2+1) × voting countries
- Voting countries = participating countries (+ 1 rest of the world if enabled, introduced in 2023)
- Minus the sum of all entered televoting scores
- Winner: Country with highest combined jury + televoting score
Run the test suite:
uv run pytest testsThe tests use EurovisionAPI/dataset and test data from 2016 to 2025 included.
The tests include:
- Score calculation accuracy
- File parsing functionality
- CLI interface testing
- Rich: Beautiful terminal UI, tables, and animations
- Typer: Modern CLI framework
- pytest: Testing framework
Development dependencies:
- basedpyright: Type checking
- ruff: Linting and formatting
- orjson: Fast JSON parsing for tests
This project is open source under the MIT License.