Package: competitive-dl
Note :This tool is to be used foreducationalpursosesonlyand not for any other commercial useFeaturesDownload any problem/problem set from any contest/archives from any competitive website as PDF for offline practice !You can download to any desired directory of your choice !Get the HTML source of the problem page as well as the problem containerGet the problem statement , input & output samples as textCompetitive sites from which download is possible (so far):CodeforcesSpojCodechefDemoAs a command line application (CLI)As a python moduleFor sites with dynamic content like codechef ,StaticScraper()is replaced withDynamicScraper()RequirementsGeneral requirementsModules that get automatically installedpdfkitBeautifulSoup4Modules that will have to be installedmanuallywkhtmltopdfsudoapt-getinstall wkhtmltopdfAdditional requirements (to scrape from dynamic sites)Modules that get automatically installedselenium pythonpython xvfbwrapperModules that will have to be installedmanuallyXvfb (actually a requirement of xvfbwrapper)sudoapt-getinstall XvfbInstallationFrom this repositorygitclonehttp://github.com/shravan97/competitive-dlcdcompetitive-dlpythonsetup.pyinstallUsing pippipinstallcompetitive-dlUsageAs a CLIusage:competitive-dl[-h][-sSITE][-cCONTEST][-pPROBLEM][-dDIR][-oFILENAME][-lLANGUAGE]optionalarguments:-h,--helpshowthishelpmessageandexit-sSITEThecompetitivesite,foreg.codeforces,spoj...etc-cCONTESTContest-idorarchive,foreg.682,classical..etc-pPROBLEMProblemcode,foreg.COINS,A,1...etc-dDIRDirectorywhereyourfilehastobesaved-oFILENAMEPDFfilename-lLANGUAGELanguageinwhichcontenthastobesaved.ThisdependsonthelanguagesofferedbythecompetitivesiteAs a ModulefromcompetitiveDlimportutilc=util.StaticScraper('spoj','classical','PALIN',dr='/home/shravan97/Desktop/',out='favourite.gif')c.get_pdf()Sample usagecompetitive-dl-scodeforces-c682-pC-otree_problem.pdfcompetitive-dl-sspoj-pPALIN-dir/home/shravan97/Desktop-omy_fav_problem.pdfPlease check out the demo PDF fileshereListed below are a few cool upcoming features !UpcomingDownload problems with your own HTML template for the PDF !Merge multiple problems from different websites into a PDF with your own template !Download from a lot more competitive sites likeTopcoder,Hackerearth….etc !ContributionsIf you find an idea that could be implemented here , please feel free to give a pull request or put that up as an issuehere:smile:Contributorsshravan97LicenseThe MIT License (MIT)
Copyright (c) 2016 SHRAVAN MURALIPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THIS SOFTWARE CAN BE USED FOR EDUCATIONAL PURPOSES ONLYTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.