Python Code for ECF Chess Performance

General discussions about grading.
Post Reply
User avatar
Arnav Sud
Posts: 18
Joined: Tue Apr 26, 2022 7:47 pm

Python Code for ECF Chess Performance

Post by Arnav Sud » Wed Apr 27, 2022 3:31 pm

I made a program in Python that goes to ECF website, searches for player names, and then displays their latest games and statistics as per user input. The code is available on Github - feel free to use and run it as per usual licensing policy (you will need a Python Compiler/Interpreter installed - I recommend PyCharm).

Code here: https://gist.github.com/infinitless/2a6 ... d9ca9606d4

Sample Output:

Code: Select all

Enter Player's (approx.) First Name (e.g Joh for John): will
Enter Player's (approx.) Last Name (e.g Smi for Smith): smith
+-------+-----------------------+------------+-----------+------------------------+----------+------------+
|   Row | Full_Name             | ECF_code   | FIDE_no   | Club                   | Gender   | LastGame   |
|-------+-----------------------+------------+-----------+------------------------+----------+------------|
|     1 | Smith, William        | 343587J    |           | Yate & Sodbury         | M        | 2022-03-01 |
|     2 | Smith, William        | 317563H    |           | Essex          *       | M        | 2019-08-31 |
|     3 | Smithyes, Will        | 315528G    |           | Sussex Juniors         | M        | 2019-07-21 |
|     4 | Smith, William        | 304955D    |           | Woodbridge School      | M        | 2019-02-06 |
|     5 | Smith, Will           | 309450K    |           | Churchill Academy      |          | 2017-11-20 |
|     6 | Smith, Joseph William | 305818K    |           | Middlesex Juniors      | M        | 2016-04-24 |
|     7 | Smith, William H      | 291403H    |           | York           *       |          | 2012-09-09 |
|     8 | Smith, Will           | 281547D    |           | Aylesbury GS           |          | 2010-03-10 |
|     9 | Smith, William        | 273023G    |           | Kent Junior Congresses | M        | 2007-09-30 |
|    10 | Smith, William AW     | 251827C    |           | Gateway School         | M        | 2005-12-03 |
|    11 | Smith, William B      | 119379L    |           | Whitehaven             | M        | 2005-09-09 |
|    12 | Smith, William        | 257035L    |           | Coulsdon Chess Club    | M        | 2004-01-01 |
|    13 | Smith, William        | 224569D    |           | Wantage                | M        | 2003-03-18 |
|    14 | Smith, William        | 174878G    |           | Barking                | M        |            |
+-------+-----------------------+------------+-----------+------------------------+----------+------------+
Choose Row Number: 1
Enter how many past games you want to see: 10
Statistics:
Percentage Score: 20 %
Current Rating: 1380
Rating change: -407
Average Opponent Rating: 1423
+-------+------------+----------+---------+----------------------+---------+-------------+---------+
|   Row | Date       | Colour   |   Score | Versus               |   Rated |   NewRating |   Diff. |
|-------+------------+----------+---------+----------------------+---------+-------------+---------|
|     1 | 2022-03-01 | White    |       1 | Curtis, Tony         |    1464 |        1380 |      84 |
|     2 | 2022-02-17 | Black    |       0 | Stinchcombe, Michael |    1368 |        1255 |     113 |
|     3 | 2022-01-18 | White    |       0 | McAllister, Frazer   |    1104 |        1315 |    -211 |
|     4 | 2021-12-07 | White    |       0 | Cullen, Gareth       |    1702 |        1514 |     188 |
|     5 | 2021-11-09 | White    |       0 | Newton, Conor        |    1514 |        1567 |     -53 |
|     6 | 2021-10-12 | White    |       1 | LeRoy, Jason         |    1387 |        1787 |    -400 |
+-------+------------+----------+---------+----------------------+---------+-------------+---------+

Wadih Khoury
Posts: 522
Joined: Sun Jul 12, 2020 8:14 pm

Re: Python Code for ECF Chess Performance

Post by Wadih Khoury » Thu Apr 28, 2022 10:21 am

Looks fun. What does it do more than the website? We currently can see all the games and rating impacts natively.

User avatar
Arnav Sud
Posts: 18
Joined: Tue Apr 26, 2022 7:47 pm

Re: Python Code for ECF Chess Performance

Post by Arnav Sud » Thu Apr 28, 2022 1:38 pm

Wadih Khoury wrote:
Thu Apr 28, 2022 10:21 am
Looks fun. What does it do more than the website? We currently can see all the games and rating impacts natively.
Currently just basic statistics really. But once the data is there it can be used to calculate predictions (https://www.318chess.com/elo.html), best wins, worst losses, easiest opponent, most formidable opponent etc. and plot graphs. I just use it to check how a particular player has been doing recently. The LMS is not so user friendly imho and it sometimes even misses finding player names...

User avatar
Joey Stewart
Posts: 1411
Joined: Wed Apr 11, 2007 2:35 pm
Location: All Of Them
Contact:

Re: Python Code for ECF Chess Performance

Post by Joey Stewart » Thu Apr 28, 2022 11:39 pm

Brilliant work there, I absolutely hated the fact that you can no longer see opponents names when searching results history (as well as the fact they wiped almost 20 years worth of archived results when the "improved" site was created) so anything that improves this gets a big thumbs up from me !
Lose one queen and it is a disaster, Lose 1000 queens and it is just a statistic.

Roger de Coverly
Posts: 20147
Joined: Tue Apr 15, 2008 2:51 pm

Re: Python Code for ECF Chess Performance

Post by Roger de Coverly » Fri Apr 29, 2022 10:35 am

Joey Stewart wrote:
Thu Apr 28, 2022 11:39 pm
as the fact they wiped almost 20 years worth of archived results when the "improved" site was created) s
It's all still there.

https://www.ecfrating.org.uk/v2/new/lis ... de=240800E

User avatar
Joey Stewart
Posts: 1411
Joined: Wed Apr 11, 2007 2:35 pm
Location: All Of Them
Contact:

Re: Python Code for ECF Chess Performance

Post by Joey Stewart » Fri Apr 29, 2022 7:37 pm

What did you do to create that? Whenever I tried to search it just said old grades not available
Lose one queen and it is a disaster, Lose 1000 queens and it is just a statistic.

Roger de Coverly
Posts: 20147
Joined: Tue Apr 15, 2008 2:51 pm

Re: Python Code for ECF Chess Performance

Post by Roger de Coverly » Fri Apr 29, 2022 8:07 pm

Joey Stewart wrote: What did you do to create that?
go to www.ecfrating.org,uk
type "Stewart" whih finds 11 rated players
Click on the ECF rating code 240800E
This gives a summary of data
Click on "View OTB Results"
This gives results for 2022
Change "2022" (second line down) to "All Seasons" Click to the right of "2022" to get the selection dropdown.

That's for a Windows pc.

User avatar
Matt Mackenzie
Posts: 4296
Joined: Tue Mar 31, 2009 11:51 pm
Location: Millom, Cumbria

Re: Python Code for ECF Chess Performance

Post by Matt Mackenzie » Fri Apr 29, 2022 10:21 pm

Works fine for me too.
"Set up your attacks so that when the fire is out, it isn't out!" (H N Pillsbury)

User avatar
Joey Stewart
Posts: 1411
Joined: Wed Apr 11, 2007 2:35 pm
Location: All Of Them
Contact:

Re: Python Code for ECF Chess Performance

Post by Joey Stewart » Sat Apr 30, 2022 8:19 pm

Just to prove I'm not an idiot though, try using this link to my profile.
https://www.ecfrating.org.uk/v2/new/pla ... de=240800E
scroll down to rating history and click on one of the old ecf grades which used to show that seasons games but now gives an error message if you try and search that way.
Lose one queen and it is a disaster, Lose 1000 queens and it is just a statistic.

Nick Burrows
Posts: 1478
Joined: Sat Aug 14, 2010 12:15 pm

Re: Python Code for ECF Chess Performance

Post by Nick Burrows » Sat Apr 30, 2022 9:17 pm

Joey Stewart wrote:
Sat Apr 30, 2022 8:19 pm
Just to prove I'm not an idiot
You don't need to prove it

Post Reply