shravan97 / competitive-dl

:file_folder: Download any problem/problem set from any contest/archives from any competitive website as PDF for offline practice!
Other
22 stars 3 forks source link
command-line competitive-sites contest pdf

:file_folder: Competitive - dl

Note : This tool is to be used for educational pursoses only and not for any other commercial use

Features

Demo

As a command line application (CLI)

cli_demo

As a module

ezgif com-video-to-gif

For sites with dynamic content like codechef , StaticScraper() is replaced with DynamicScraper()

Requirements

General requirements
Additional requirements (to scrape from dynamic sites)

Installation

From this repository
git clone http://github.com/shravan97/competitive-dl 
cd competitive-dl 
python setup.py install  
Using pip

pip install competitive-dl

Usage

As a CLI
usage: competitive-dl [-h] [-s SITE] [-c CONTEST] [-p PROBLEM] [-d DIR] [-o FILENAME]
               [-l LANGUAGE]

optional arguments:
  -h, --help   show this help message and exit
  -s SITE      The competitive site , for eg. codeforces , spoj ...etc
  -c CONTEST   Contest-id or archive , for eg. 682 , classical..etc
  -p PROBLEM   Problem code , for eg. COINS , A , 1...etc
  -d DIR       Directory where your file has to be saved
  -o FILENAME  PDF file name
  -l LANGUAGE  Language in which content has to be saved . This depends on the
               languages offered by the competitive site
As a Module
from competitiveDl import util
c = util.StaticScraper('spoj','classical','PALIN',dr='/home/shravan97/Desktop/',out='favourite.pdf')
c.get_pdf()

Sample usage

competitive-dl -s codeforces -c 682 -p C -d demo -o tree_problem.pdf 
competitive-dl -s spoj -p PALIN -d demo -o my_fav_problem.pdf 

Please check out the demo PDF files here

Listed below are a few cool upcoming features !

Upcoming

Contributions

If you find an idea that could be implemented here , please feel free to give a pull request or put that up as an issue here :smile:

Contributors

License

The MIT License (MIT) Copyright (c) 2016 SHRAVAN MURALI

Permission 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 ONLY

THE 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.