Python MIT

leetcode-anki

Anki cards generator for Leetcode

F

fspv

Dernière activité 28 mars 2026
fspv/leetcode-anki

427

étoiles

59

forks

7

issues ouvertes

ankileetcodepython

Ce README est souvent en anglais.

build style tests types license

Leetcode Anki card generator

Summary

By running this script you'll be able to generate Anki cards with all the leetcode problems.

I personally use it to track my grinding progress.

ezgif-7-03b29041a91e

photo_2021-09-29_08-58-19 jpg 2 photo_2021-09-29_08-58-21 jpg 2 photo_2021-09-29_08-58-23 jpg 2

Prerequisites

  1. python3.8+ installed
  2. python virtualenv installed
  3. git cli installed
  4. GNU make installed (optional, can run the script directly)
  5. *nix operating system (Linux, MacOS, FreeBSD, ...). Should also work for Windows, but commands will be different. I'm not a Windows expert, so can't figure out how to make it work there, but contributions are welcome.

How to run

First download the source code

git clone https://github.com/prius/leetcode-anki.git
cd leetcode-anki

After that initialize and activate python virtualenv somewhere

Linux/MacOS

virtualenv -p python leetcode-anki
. leetcode-anki/bin/activate

Windows

python -m venv leetcode-anki
.\leetcode-anki\Scripts\activate.bat

Then initialize necessary environment variables. You can get it directly from your browser cookies (csrftoken and LEETCODE_SESSION)

Linux/Macos

export LEETCODE_CSRF_TOKEN="xxx"
export LEETCODE_SESSION_ID="yyy"

Windows

set LEETCODE_CSRF_TOKEN="xxx"
set LEETCODE_SESSION_ID="yyy"

And finally run for Linux/MacOS

make generate

Or for Windows

pip install -r requirements.txt
python generate.py

You'll get leetcode.apkg file, which you can import directly to your anki app.

Projets similaires

An intelligent, automatic Anki flashcard generator designed for Chinese speakers learning English.

Pythonankipython
Yyaoyhu
186 étoiles13

All Python solutions for Leetcode

Pythonleetcodeleetcode-pythonleetcode-questions
Ccnkyrpsgl
537 étoiles213

Demonstrate all the questions on LeetCode in the form of animation.(用动画的形式呈现解LeetCode题目的思路,完整单步/回看/变速/语音讲解在 algomooc.com)

Javaanimationleetcodeleetcode-c
MMisterBooo
76,7 k étoiles13,9 k