OCR-based match result reader for eFootball screenshots — extracts winner, score, usernames and phase.
Project description
efootball_ocr
A Python module that reads eFootball match result screenshots and extracts:
| Field | Example |
|---|---|
| Home username | hazziboss |
| Away username | MEMPHISDPAY |
| Home team name | Hazzi Fc |
| Away team name | MEMPHISDEPAY |
| Score line | 4 – 0 |
| Winner | hazziboss |
| Match phase | Full Time / After Extra Time |
| Match date | 2026-04-28 10:18 |
Supported screenshot types
1. Result screen (dark background)
The post-match screen that shows the final score in large yellow text with the two club badges and usernames beneath them.
[Left badge] Full Time [Right badge]
[Left badge] 0 – 6 [Right badge]
hotboykolz Hazzi Fc
2. Stats screen (yellow/blue chevron background)
The in-game statistics panel that shows the score in its header row and lists possession, shots, passes, etc.
Standard:
HUNTER 0 = 0 Hazzi Fc
Full Time
Possession 35% | 65%
...
Penalty shootout variant — an extra X PK Y line appears between the score and the phase label:
HUNTER 0 = 0 Hazzi Fc
4 PK 3
Full Time
Possession 35% | 65%
...
3. Match history card (compact dark banner)
The compact match history card shown in match lists / replays.
28/04/2026 10:18
[badge] Hazzi Fc 4 - 0 MEMPHISDEPAY [badge]
hazziboss MEMPHISDPAY
Installation
1. Install Tesseract-OCR (system dependency)
macOS
brew install tesseract
Ubuntu / Debian
sudo apt-get install tesseract-ocr
Windows Download the installer from https://github.com/UB-Mannheim/tesseract/wiki
2. Install Python packages
pip install -r efootball_ocr/requirements.txt
Quick start
from efootball_ocr import EFootballResultReader
reader = EFootballResultReader()
# Works with all three screenshot types automatically
result = reader.read("screenshot.png")
print(result.winner) # "hazziboss"
print(result.score_line) # "4 – 0"
print(result.home_username) # "hazziboss"
print(result.away_username) # "MEMPHISDPAY"
print(result.match_date) # "2026-04-28 10:18" (card format only)
print(result) # full one-line summary
Process multiple screenshots at once
paths = ["match1.png", "match2.png", "match3.png"]
results = reader.read_batch(paths)
for r in results:
print(r)
Force a specific screen type
# Skip auto-detection
reader = EFootballResultReader(force_screen_type="card")
result = reader.read("history_card.png")
MatchResult fields
| Field | Type | Description |
|---|---|---|
home_username |
str |
Home player's account/login name (smaller text) |
away_username |
str |
Away player's account/login name (smaller text) |
home_team |
str |
Home club display name (larger bold text) |
away_team |
str |
Away club display name (larger bold text) |
home_score |
int |
Regular / AET goals scored by home (-1 if undetected) |
away_score |
int |
Regular / AET goals scored by away (-1 if undetected) |
home_pen_score |
int |
Penalty shootout goals by home (-1 if no penalties) |
away_pen_score |
int |
Penalty shootout goals by away (-1 if no penalties) |
winner |
str | None |
Winning username (uses penalty score if regular scores tied), or None for a draw |
score_line |
str |
Human-readable score, e.g. "0 – 0 (PK 4 – 3)" when penalties |
penalty_score_line |
str |
Just the penalty score "4 – 3", or "" if no penalties |
phase |
str |
"Full Time", "After Extra Time", "Penalties", or "Unknown" |
match_date |
str |
ISO date string "YYYY-MM-DD HH:MM" when present (card format) |
screen_type |
str |
"result", "stats", "card", or "Unknown" |
confidence |
float |
0–1 estimate of parse quality |
raw_text |
str |
Full OCR dump — useful for debugging |
Auto-detection logic
| Condition | Detected type |
|---|---|
| Image width / height > 2.5 (wide banner) | card |
| Yellow dominates top third of image | stats |
| Dark background, no dominant yellow | result |
| None of the above | tries all three, picks highest confidence |
Demo
python efootball_ocr/demo.py
Expected output:
=== Post-match result screen (IMG_3276) ===
Screen type : result
Phase : Full Time
Home team : hotboykolz
Home username : hotboykolz
Away team : Hazzi Fc
Away username : Hazzi Fc
Score : 0 – 6
Winner : Hazzi Fc
Confidence : 100%
=== Match history card (image_1777750058365) ===
Screen type : card
Phase : Full Time
Date : 2026-04-28 10:18
Home team : Hazzi Fc
Home username : hazziboss
Away team : MEMPHISDEPAY
Away username : MEMPHISDPAY
Score : 4 – 0
Winner : hazziboss
Confidence : 100%
Tips for best accuracy
- Use full-resolution screenshots — don't crop or resize before passing in.
- If
result.confidenceis below 0.75, checkresult.raw_textto see what Tesseract actually read. - For non-Latin usernames, install the matching Tesseract language pack.
- The card parser detects the format by aspect ratio (width/height > 2.5) — if your card is cropped square, pass
force_screen_type="card"explicitly.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file efootball_ocr-1.0.0.tar.gz.
File metadata
- Download URL: efootball_ocr-1.0.0.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
149ec57b2f2132c29aabd99f75f4e7ad30b4b8752f41c36034e10af81a55c8a0
|
|
| MD5 |
54a27b621213b9c7e8e7d2d5ef6df4d7
|
|
| BLAKE2b-256 |
53dc939f310fabf3830275a5db5d481d3649e70c2f0897c7dde2415b7ed0a2f0
|
File details
Details for the file efootball_ocr-1.0.0-py3-none-any.whl.
File metadata
- Download URL: efootball_ocr-1.0.0-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3691eab37fba76ae167cb9836755de07c3b008c8dc53493224f5dc51173fd29d
|
|
| MD5 |
5db8d1f5edd140b3d60c141960140b60
|
|
| BLAKE2b-256 |
285c8c1ef5b5a93430afa306a0fb8347629ac33e15345afe812ac279af85e5a5
|