CodeChef Rating Predictor using Python3

Distributed web scraping could result in DoS.
I would suggest to do it once just after the contest by someone interested and post it as a topic in here.
Predicting rating changes during the contest is not so fair.
That might be the reason why CodeChef restricted its API.

1 Like

yes, plz post list of div2 too

Hello Everyone, Me and @anon73162591 have worked on a much faster and efficient approach to this. I am yet to integrate the changes in the main codebase. I was working on something else but I will make the changes before this weekend for sure. Also the we have replaced PyQt with normal python requests so after the next updates the Network error issue should also be resolved.

2 Likes

How do you bypass ‘hold right there sparky’ page?

When will cook off rating be updated?

The new method won’t exactly parse/scrape the ranklist from web.

1 Like

when do you guys push the updated code in the github repository?

@ankurkayal by Friday this week

Oh cool!

1 Like

I have made the required changes. Now it works a lot faster and contests with around 3000 participants can be done within 4-5 mins.

P.S.
If anyone can help me parse the ranklist for a given contest without using PyQt please comment.
I cannot run multiple threads with PyQt WebEngine for some reason.

Also I would like to thank @anon73162591 and @anon96721856 for helping me with this project.

3 Likes

Where can i find the new predictor as you have not updated it on github yet?

It’s available on github.

You don’t need to run for every contest. For the start, you can add cron jobs to add 3 monthly contests of codechef such that they are added in contest list every month automatically and old data is deleted. You need to delete old data for few reasons like you don’t want to waste your processing power for old contests and moreover most online free DBs like mLab have limit of 512Mb or less so you can’t store that many contests.

Here’s how my cron jobs were for another predictor.

Here is the reason - https://blog.codechef.com/2020/01/20/api/

1 Like

I’m facing a few problems, all imports related to PyQt5 aren’t working, I’ve tried out most of the fixes suggested on stackoverflow, and still couldn’t get it to work.

I’ve wasted enough time on it already, could you help me with this:

Traceback (most recent call last):
  File "main.py", line 6, in <module>
    from ranklist_parser import RankListParser
  File "/home/i_64/codechef_rating_v0-master/ranklist_parser.py", line 6, in <module>
    from page import Page
  File "/home/i_64/codechef_rating_v0-master/page.py", line 2, in <module>
    from PyQt5.QtWebEngineWidgets import QWebEnginePage
ModuleNotFoundError: No module named 'PyQt5'

I’ve triedinstalling and uninstalling the packages, and I found out these modules, which python can’t find have been moved to separate packages, soI tried installing that too, but it didn’t work.

If someone gets this script to work, just let me know, or atleast send the csv for current contest.

Thanks :slight_smile:

Its not working as i am not able to find my name in generated list.

I can’t get mine even working. Did you got errors?

How did you get it to work, or even forget that

Could you just post the CSV here please?

sorry i deleted it.

You could use crontabs to do that. Schedule for a time interval. Just google it :smiley: