dragonslayerx's blog

By dragonslayerx, 4 years ago, In English,

Hi fellow coders,

Recenty I was searching for a tool that could import my Codeforces submissions and categorize them based on their tags. The aim was to recognize my weak areas and work more towards them. Finally, I decided to build something on my own.

Codeforces Importer is a script written in python that uses Codeforces API to fetch user submissions category- wise. It import user submission statistics using Codeforces API, imports their source-codes and perform their categorization based on their codeforces tags.

Github Link to the project : https://github.com/dragonslayerx/CodeforcesImporter

Readme: https://github.com/dragonslayerx/CodeforcesImporter/blob/master/README.md

The submissions source codes are imported to a local directory and a HTML page where links to problem, submission at Codeforces and imported source-code are present.

Users can use the page to access their solutions and perform category-wise analysis. It ignores the submissions downloaded previously thus making successive updation of local-repository faster.

We would like to thank Mike Mirzayanov for providing Codeforces API that helped us making this tool.

Just a screenshot

Generated HTML showing user statistics:

Generated HTML providing links to submissions along with their problem links

Please feel free to report bugs as well as feature changes, I will try to incorporate these. Hope you will find this tool useful.

Please contact at Ashish Chauhan (meashish), Swapnil Saxena (dragonslayerx), Ayush Awasthi (ayush_awasthi)

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

»
4 years ago, # |
  Vote: I like it +17 Vote: I do not like it

It doesn't work properly on Unix-based operating systems.. in Unix, we use file/..., not file... Otherwise its quite nice :)

»
4 years ago, # |
  Vote: I like it +17 Vote: I do not like it

Nice tool. Just a little tip for Github: Don't upload automatically generated files like the *.pyc ones or the .idea folder. You should write a .gitignore for such things.

»
4 years ago, # |
Rev. 2   Vote: I like it +35 Vote: I do not like it

Some topics are more common than others. It's impressive to solve e.g. 90 out of 100 existing problems marked as geometry. It's not so impressive to solve 90 out of hundreds of problems marked as implementation or math. Please consider adding percentage values of solved problems in topics. Or maybe a progress bar? Either way, it would be necessary to check the total number of problems in each topic.

And what is the algorithm to sort topics in a generated HTML? Can it be alphabetical to easily search for topics?

Why the number of "Total-Submissions" (570) slightly differs from the number of downloaded codes (380)? I would guess that problems with two or more topics are counted many times but then the difference would be much bigger.

Thank you for an awesome tool!

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    Thank you for your suggestions. We will surely add a progress-bar for each category of problems. Actually we want it to sort it by difficulty for each cateogry but that would be a tough job considering Div1 A, B, C are Div2 C, D, E. Relying on index for sorting does not yields somethng useful. Can you suggest us some way to tackle this problem ?.

    Regarding submission count seems like the issue is due to gym problem not being public and unable to be extracted. We will fix the issue soon.

    Thanks once again :)

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      "we will surely add a progress-bar" — great!

      "sorting problems" — I don't see a better way to estimate the difficulty than to check the number of people who solved it. Btw. it's possible in CF link. But maybe sorting by the date of submission (or the date of problem creation) would be better? I think it should be easier to search for problems then.

      And my previous question was about sorting topics, not problems. The alphabetic order would be ok I think.

»
4 years ago, # |
Rev. 2   Vote: I like it +5 Vote: I do not like it

please, add extensions to submissions, it will be prettier :)
looks os.open creates file with 0755 permissions. My ls colors submissions as executable, and it looks awful :). So, it's better to set it manually to 644 — os.open(file, flags, 0644). Unfortunatly, I don't know if it works on windows
Anyway, your code and documentation are wonderful!

»
4 years ago, # |
  Vote: I like it +6 Vote: I do not like it
  1. It seems that if I didn't solve any problem in a tag, then this tag won't be shown in this generated html file? In that case, I think this tool is still not helpful enough for someone like me who only solved few problems on few tags.
  2. How to I custom this tool so that I make it only generate this html file without downloading my previous submissions? This might add unnecessary network stress.
  3. Thanks a lot for this tool, it's really really helping me a lot!
»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

thank you for this useful tool :)

i'm working on same project for my graduation project ... i wonder what API have you used to get all submission for specific handle ?

i can't find easy way to do that :(