It reads pgn file and generate rating and save to sqlite db.
* Install python
* Install pandas with pip install pandas
* Get the files in the repo.
Code: Select all
import glicko_assessor
dbname = 'meltwater.db' # sqlite db
meltwater = glicko_assessor.GlickoAssessor(
dbname,
init_rating=2700,
init_rating_deviation=50
)
# 1st rating period
pgnfn = './pgn/1-skillingopp20.pgn'
meltwater.generate_rating(pgnfn)
meltwater.print_rating()
Code: Select all
Name Rating RD Volatility Games Pts PtsRate MinRating MaxRating
1 Nakamura, Hikaru 2716 44 0.059954 15 9.0 0.600 2628 2804
2 Carlsen, Magnus 2716 44 0.059954 15 9.0 0.600 2628 2804
3 Aronian, Levon 2711 44 0.059933 15 8.5 0.567 2623 2799
4 So, Wesley 2711 44 0.059933 15 8.5 0.567 2623 2799
5 Nepomniachtchi, Ian 2711 44 0.059933 15 8.5 0.567 2623 2799
6 Giri, Anish 2705 44 0.059920 15 8.0 0.533 2617 2793
7 Vachier-Lagrave, Maxime 2705 44 0.059920 15 8.0 0.533 2617 2793
8 Le, Quang Liem 2705 44 0.059920 15 8.0 0.533 2617 2793
9 Firouzja, Alireza 2705 44 0.059920 15 8.0 0.533 2617 2793
10 Radjabov, Teimour 2705 44 0.059920 15 8.0 0.533 2617 2793
11 Ding, Liren 2700 44 0.059916 15 7.5 0.500 2612 2788
12 Vidit, Santosh Gujrathi 2688 44 0.059933 15 6.5 0.433 2600 2776
13 Anton Guijarro, David 2688 44 0.059933 15 6.5 0.433 2600 2776
14 Svidler, Peter 2683 44 0.059954 15 6.0 0.400 2595 2771
15 Karjakin, Sergey 2677 44 0.059984 15 5.5 0.367 2589 2765
16 Duda, Jan-Krzysztof 2666 44 0.060070 15 4.5 0.300 2578 2754
Rating list after all prelim games of meltwater tour. Note they started at r=2700, rd=50
Code: Select all
meltwater = glicko_assessor.GlickoAssessor(
dbname,
init_rating=2700,
init_rating_deviation=50
)
Code: Select all
Name Rating RD Volatility Games Pts PtsRate MinRating MaxRating
1 Carlsen, Magnus 2770 28 0.059424 156 95.0 0.609 2714 2826
2 Nakamura, Hikaru 2765 27 0.059477 150 89.0 0.593 2711 2819
3 Aronian, Levon 2763 27 0.059356 168 98.5 0.586 2709 2817
4 Artemiev, Vladislav 2759 31 0.059820 87 52.0 0.598 2697 2821
5 So, Wesley 2748 27 0.059557 170 97.5 0.574 2694 2802
6 Firouzja, Alireza 2741 31 0.059649 105 60.0 0.571 2679 2803
7 Radjabov, Teimour 2740 29 0.059648 127 69.5 0.547 2682 2798
8 Caruana, Fabiano 2730 44 0.060045 15 10.0 0.667 2642 2818
9 Giri, Anish 2726 28 0.059467 144 76.0 0.528 2670 2782
10 Vachier-Lagrave, Maxime 2725 29 0.059355 129 67.0 0.519 2667 2783
11 Mamedyarov, Shakhriyar 2718 29 0.059603 117 59.5 0.509 2660 2776
12 Nepomniachtchi, Ian 2717 34 0.059626 71 38.0 0.535 2649 2785
13 Le, Quang Liem 2712 35 0.059756 60 31.5 0.525 2642 2782
14 Erigaisi, Arjun 2707 44 0.059923 15 8.0 0.533 2619 2795
15 Dominguez Perez, Leinier 2705 37 0.059786 45 22.5 0.500 2631 2779
16 Duda, Jan-Krzysztof 2702 29 0.059680 113 53.5 0.473 2644 2760
17 Ding, Liren 2697 35 0.059903 60 29.0 0.483 2627 2767
18 Praggnanandhaa, R 2695 44 0.059918 15 7.0 0.467 2607 2783
19 Iturrizaga Bonelli, Eduardo 2695 44 0.059918 15 7.0 0.467 2607 2783
20 Shankland, Sam 2694 44 0.059919 15 7.0 0.467 2606 2782
21 Gukesh, D 2690 44 0.059929 15 6.5 0.433 2602 2778
22 Tari, Aryan 2688 40 0.059840 30 13.5 0.450 2608 2768
23 Naroditsky, Daniel 2688 44 0.059934 15 6.0 0.400 2600 2776
24 Vidit, Santosh Gujrathi 2686 33 0.059594 75 34.5 0.460 2620 2752
25 Grandelius, Nils 2684 44 0.059947 15 6.0 0.400 2596 2772
26 Harikrishna, Pentala 2683 41 0.059878 26 11.0 0.423 2601 2765
27 Karjakin, Sergey 2682 37 0.059837 45 20.0 0.444 2608 2756
28 Dubov, Daniil 2680 34 0.059630 71 32.0 0.451 2612 2748
29 Svidler, Peter 2679 37 0.059780 45 19.5 0.433 2605 2753
30 Salem, A.R. Saleh 2679 44 0.059975 15 5.5 0.367 2591 2767
31 Bluebaum, Matthias 2678 44 0.059980 15 5.5 0.367 2590 2766
32 Van Foreest, Jorden 2677 37 0.059939 45 19.0 0.422 2603 2751
33 Adhiban, Baskaran 2675 40 0.059924 30 12.0 0.400 2595 2755
34 Ju, Wenjun 2673 44 0.060011 15 5.0 0.333 2585 2761
35 Grischuk, Alexander 2670 38 0.059849 41 16.5 0.402 2594 2746
36 Hansen, Eric 2659 44 0.060134 15 3.5 0.233 2571 2747
37 Hou, Yifan 2656 44 0.060173 15 3.5 0.233 2568 2744
38 Jones, Gawain C B 2650 44 0.060248 15 3.0 0.200 2562 2738
39 Anton Guijarro, David 2649 36 0.059881 56 20.5 0.366 2577 2721
40 Liang, Awonder 2648 44 0.060275 15 2.5 0.167 2560 2736
41 Mishra, Abhimanyu 2645 44 0.060325 15 2.5 0.167 2557 2733
42 Koneru, Humpy 2639 44 0.060415 15 2.0 0.133 2551 2727
43 Christiansen, Johan-Sebastian 2633 44 0.060520 15 1.5 0.100 2545 2721
44 Pichot, Alan 2602 40 0.060648 30 4.0 0.133 2522 2682
Query the pgn table of meltwater db.
Code: Select all
for row in meltwater.query("select * from pgn"):
print(row)
Code: Select all
(1, '1-skillingopp20.pgn')
(2, '2-airthingsmastp20.pgn')
(3, '3-operaeurp21.pgn')
(4, '4-mcpi21.pgn')
(5, '5-nicclassp21.pgn')
(6, '6-ftxcryptocup21.pgn')
(7, '7-goldmoneyrapp21.pgn')
(8, '8-chessablemastp21.pgn')
(9, '9-aimchessusp21.pgn')
(10, '10-meltwaterfin21.pgn')