Skip to content

Getting Started

Installation

Start by installing the package from pip or conda:

pip install leetscrape
conda install leetscrape
poetry add leetscrape

Commands

  • leetscrape list [–out OUT] - List all questions without generating code stub.
options:
-h, --help         show a help message and exit
--out OUT, -o OUT  Specify the output file name to store the list of questions.
  • leetscrape question [–out OUT] qid [qid …] - Generate a code stub for the given question(s).
positional arguments:
qid                Enter Leetcode question ID(s)

options:
-h, --help         show this help message and exit
--out OUT, -o OUT  Enter the path to the output directory
  • leetscrape solution [-h] [–out OUT] input - Generate mdx files from solutions.
positional arguments:
input              Enter the path to the solution directory with solution files or to a single
                    solution file

options:
-h, --help         show this help message and exit
--out OUT, -o OUT  Enter the path to the output directory to save solutions mdx files
  • leetscrape ts [–out OUT] - Create the leetscrape-ts Next.js project to host the solutions.
options:
-h, --help         show this help message and exit
--out OUT, -o OUT  Enter the path to the output directory to save the project