### dragonslayerx's blog

By dragonslayerx, 4 years ago, ,

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

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)

• +148

 » 4 years ago, # |   +17 It doesn't work properly on Unix-based operating systems.. in Unix, we use file/..., not file... Otherwise its quite nice :)
•  » » 4 years ago, # ^ |   +11 Thanks for reporting, we have fixed it..
•  » » » 4 years ago, # ^ |   +6 You can check the new release at https://github.com/dragonslayerx/CodeforcesImporter/releases
 » 4 years ago, # |   +17 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, # ^ |   +3 Thanks... :)
 » 4 years ago, # | ← Rev. 2 →   +35 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, # ^ |   +10 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, # ^ |   +1 "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 →   +5 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 windowsAnyway, your code and documentation are wonderful!
•  » » 4 years ago, # ^ |   0 Thanks Igorjan94. Be assured, we will remove this bug in our next release. :)
 » 4 years ago, # |   +6 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. 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. Thanks a lot for this tool, it's really really helping me a lot!
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 Thanks for your feedback XDPlus. We will definitely provide an option in our next release to prevent downloading submissions if user doesnt want to.
•  » » 4 years ago, # ^ |   +1 Fixed: Checkout our new release https://github.com/dragonslayerx/CodeforcesImporter/releases/tag/v1.2.1. -i or --ignore option can be used to prevent importing submission source
•  » » » 4 years ago, # ^ |   0 Thanks! I noticed this in the PR! That was great!
 » 4 years ago, # |   0 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 :(
•  » » 4 years ago, # ^ | ← Rev. 2 →   +1
•  » » » 4 years ago, # ^ | ← Rev. 2 →   0 XDplus thanks a lot :D that's what i'm looking for :D