VastoLorde95's blog

By VastoLorde95, history, 8 years ago, In English

Hi there.

I have written a simple Python script that can do a couple of nifty things:

  1. Compare the problems solved by user X but not by user Y
  2. Give you a weekly breakdown of your problem solving performance on Codeforces
  3. Return a list of all your submissions till a specified point so that you can do your own analyses :)

Screenshot

Link

Github Repo

How to install

Pre-requisites:

  1. Python 2.7
  2. Python Beautiful Soup 4
  3. Python requests
  4. Python tabulate

Once you have the prerequisites installed, simply place the CFStat folder to the directory where you want to write your script. Then in your script use import CFStat.

Mini-Documentation

  1. getSubmissions(user, page_mx, print_flag = False): Generates a list of all submissions from the first page_mx number of pages made by user and prints this list if print_flag = True. Your submissions will be pushed into a list of 3-tuples: time-stamp of submission, problem code and verdict. You can use this list to perform any kind of additional analyses that you want :)
  2. getWeeklyStatistics(user, mx, aggregate) : Using the submissions list generated from the previous function, this generates a table for each week between start_year to end_year with statistics like % of WAs etc. Note: Week no is as per the ISO Calendar.
  3. compareUsers(user1, mx1, user2, mx2) : Using the first mx1 submissions of user1 and first mx2 pages of user2, this function prints a list of all problems solved by user1 but not by user2
  4. start_year and end_year are global variables used in getWeeklyStatistics() to generate a table for statistics for each week between start_year to end_year. Modify these according to your needs.

I guess a lot of things can be automated to make this tool more user-friendly but I got lazy handling cases with the dates and stuff so feel free to fix this for the community :P Everyone is welcome to fork the repository and contribute :)

The code may take up to a minute to fetch 50 pages of submissions and this number may change depending on your internet speed. If your connection is slow then the script might skip some of your submissions.

P.S. No this tool is not bug free and I claim no responsibility if it causes any kind of harm to your computer. Use at your own risk

  • Vote: I like it
  • +17
  • Vote: I do not like it