CFStat: A Python Script for CF Submission Statistics!

Revision en6, by VastoLorde95, 2016-08-14 13:10:03

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 :)



Github Repo

How to install


  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.


  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

Tags cfstat, tool, oye, teri


  Rev. Lang. By When Δ Comment
en6 English VastoLorde95 2016-08-14 13:10:03 13 Tiny change: ' :)\n\n![ ](http://' -
en5 English VastoLorde95 2016-08-14 13:07:09 118
en4 English VastoLorde95 2016-08-14 12:00:05 6 Tiny change: '\n\' -> '\n\'
en3 English VastoLorde95 2016-08-14 11:39:44 34 Tiny change: 'ses :)\n\nLink\' -
en2 English VastoLorde95 2016-08-14 11:31:24 1024 Tiny change: 'ses :)\n\n[Github ' - (published)
en1 English VastoLorde95 2016-08-14 11:16:39 1586 Initial revision (saved to drafts)