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)
It doesn't work properly on Unix-based operating systems.. in Unix, we use file/..., not file... Otherwise its quite nice :)
Thanks for reporting, we have fixed it..
You can check the new release at https://github.com/dragonslayerx/CodeforcesImporter/releases
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.Thanks... :)
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!
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 :)
"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.
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!
Thanks Igorjan94. Be assured, we will remove this bug in our next release. :)
Thanks for your feedback Ir1d. We will definitely provide an option in our next release to prevent downloading submissions if user doesnt want to.
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
Thanks! I noticed this in the PR! That was great!
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 :(
Something like: http://mirror.codeforces.com/api/user.status?handle=HANDLE&from=1&count=1024000
FYI: http://mirror.codeforces.com/api/help
Ir1d thanks a lot :D that's what i'm looking for :D