Skip to content

Commit 10695c3

Browse files
committed
📝 Add README.md
1 parent 80051b7 commit 10695c3

File tree

1 file changed

+135
-0
lines changed

1 file changed

+135
-0
lines changed

README.md

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# ESC Dramatic Unpause
2+
3+
A [Eurovision Song Contest](https://en.wikipedia.org/wiki/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.
4+
5+
## What is this?
6+
7+
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**.
8+
9+
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:
10+
11+
- Interactive score entry with a beautiful terminal UI
12+
- Automatic calculation of the final missing televoting score
13+
- Dramatic pause with spinner animation (because Eurovision needs drama!)
14+
- Winner announcement with celebration
15+
16+
## Features
17+
18+
- **Interactive CLI**: Enter televoting scores one by one with Rich's beautiful interface
19+
- **Smart Validation**: Prevents negative scores and validates input format
20+
- **Backtrack Support**: Go back and correct previous entries with 'b'
21+
- **Automatic Calculation**: Calculates the final country's televoting score based on ESC rules
22+
- **Dramatic Presentation**: Includes spinner animations and winner announcements
23+
- **Comprehensive Testing**: Full test suite with historical ESC data
24+
25+
## Motive
26+
27+
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.
28+
29+
## Requirements
30+
31+
- Python 3.12 or higher
32+
- Dependencies are managed via [`uv`](https://github.com/astral-sh/uv)
33+
34+
## Installation
35+
36+
1. Clone the repository:
37+
```bash
38+
git clone h
39+
cd esc-drammatic-unpause
40+
```
41+
42+
2. Install dependencies using `uv`:
43+
```bash
44+
uv sync
45+
```
46+
47+
Or using pip:
48+
```bash
49+
pip install -e .
50+
```
51+
52+
## Usage
53+
54+
### Basic Usage
55+
56+
Run the program with a jury scores file:
57+
58+
```bash
59+
python -m src
60+
```
61+
62+
### Custom Options
63+
64+
```bash
65+
python -m src --jury-path your_jury_file.txt --participating-countries 37 --rest-of-world-vote
66+
```
67+
68+
Available options:
69+
- `--jury-path`: Path to jury scores file (default: `jury.txt`)
70+
- `--participating-countries`: Number of participating countries (default: 37)
71+
- `--rest-of-world-vote` / `--no-rest-of-world-vote`: Include rest of world televote (default: enabled, introduced in 2023)
72+
73+
### Jury File Format
74+
75+
Create a text file with jury scores in the following format:
76+
```
77+
Country Name 123
78+
Another Country 456
79+
Switzerland 789
80+
```
81+
82+
Each line should contain:
83+
- Country name (can include spaces)
84+
- Score (integer, separated by space)
85+
86+
### Interactive Process
87+
88+
1. The program displays current jury scores
89+
2. Enter televoting scores for each country (except the last one)
90+
3. Use 'b' to go back and correct previous entries
91+
4. Confirm your final entry
92+
5. Watch the dramatic pause...
93+
6. See the calculated final scores and winner announcement!
94+
95+
## How It Works
96+
97+
The system follows Eurovision scoring rules:
98+
99+
1. **Jury Scores**: Pre-calculated professional jury points
100+
2. **Televoting Scores**: User enters N-1 country scores interactively
101+
3. **Final Calculation**: The last country's televoting score is automatically calculated based on:
102+
- Total available points: (12+10+8+7+6+5+4+3+2+1) × voting countries
103+
- Voting countries = participating countries (+ 1 rest of the world if enabled, introduced in 2023)
104+
- Minus the sum of all entered televoting scores
105+
4. **Winner**: Country with highest combined jury + televoting score
106+
107+
## Testing
108+
109+
Run the test suite:
110+
111+
```bash
112+
uv run pytest tests
113+
```
114+
115+
The tests use [EurovisionAPI/dataset](https://github.com/EurovisionAPI/dataset.git) and test data from 2016 to 2025 included.
116+
117+
The tests include:
118+
- Score calculation accuracy
119+
- File parsing functionality
120+
- CLI interface testing
121+
122+
## Dependencies
123+
124+
- **[Rich](https://rich.readthedocs.io/)**: Beautiful terminal UI, tables, and animations
125+
- **[Typer](https://typer.tiangolo.com/)**: Modern CLI framework
126+
- **[pytest](https://pytest.org/)**: Testing framework
127+
128+
Development dependencies:
129+
- **basedpyright**: Type checking
130+
- **ruff**: Linting and formatting
131+
- **orjson**: Fast JSON parsing for tests
132+
133+
## License
134+
135+
This project is open source under the [MIT License](LICENSE).

0 commit comments

Comments
 (0)