harwest-tool
harwest-tool copied to clipboard
Using CodeforcesApiPy and fixed Call limit
Using CodeforcesApiPy and waiting for some time to avoid Call Limit exceeded.
Thanks for the proposed contribution @VadVergasov! Great to see that you already are maintaining a python wrapper for the Codeforces API. If possible, I'd like to move away from custom request calls entirely in that case by extending your project to support APIs for (1) getting tags for a given problem and (2) getting the total number of submissions page for a user. Let me know if you have the bandwidth to add these additional functionalities else I'd be happy to contribute as well.
First of all, we need to wait for Codeforces API fixes, I've already contacted Mike Mirzayanov because if we need to get a lot of info in one request we need to use the POST method, not GET, but Codeforces responses 403 error on such requests.
(1) In Codeforces API we have problemset.problems method, but it will return the array of problems and we need to look throw the whole tasks to get their tags. So it will take some time. But for me, it takes about 0.5 seconds to get and convert the response to the dictionary with such look: tags["contestId"]["index"] = [tags]
(2) In Codeforces API we have user.status and it will return all user's submissions, so we don't need to parse tasks page by page and this will throw away some problems, connected with a page processing (like #5 I can try to edit the current realization to modify that.
Thanks for the update @VadVergasov! I guess I forgot to update #5 but I had briefly addressed it when I rolled out the --full-scan
feature. Also, I just recalled and checked that I am no more using the get_submissions_page_count
method which practically means that we can drop (2) completely. Sorry for the confusion.
Updated getting tags