GithubHelp home page GithubHelp logo

roblieblang / leetcode-anki-script Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 603 KB

Scrapes problem links from the most popular LeetCode problem sets as well as one's own lists and adds them to an Anki deck.

Python 100.00%
anki anki-connect anki-flashcards beautifulsoup blind75 grind75 leetcode neetcode150 programming python

leetcode-anki-script's Introduction

About

Inspired by this Reddit post, I made a Python program to scrape LeetCode problem links from some of the most popular problem sets and add them to an Anki deck. Anki serves as a scheduler for this study strategy, deciding for the user when to revisit problems based on their perceived difficulty.

There are thousands of LeetCode problems available to solve, but these curated lists are commonly considered to cover the most fundamental techniques, strategies, patterns, data structures and algorithms.

The purpose of this tool is not to memorize exact LeetCode solutions, but instead to devote most of one's study time to weak areas, while also tracking your progress through Anki's native capabilities.

Requirements

  • Python
  • Web driver for your browser (I use Chrome)
    • Add it to your PATH, or paste the path to the web driver in between the parentheses of webdriver.Chrome() in config.py
  • Anki
  • Anki Connect

Getting Started

  • Clone the repo to your machine
  • Create a new Python virtual environment and activate it
  • Create a .env following the .env.example in the root directory of the project
  • Start Anki (it must be running in order for the script to work)
  • Create Python virtual environment with python -m venv venv
  • Activate Python virtual environment with .\venv\Scripts\activate
  • Install dependencies with pip install -r .\requirements.txt
  • Run the program using command python main.py from a CLI in the root directory of the project

Last Tested

This script was last tested on 4/13/24 with the following configurations:

  • Anki Version: 23.12.1 (1a1d4d54)โฉ
  • AnkiConnect Version: 6
  • Python Version: 3.11.5
  • Operating System: Windows 11, Version 22H2, OS Build 22621.3007
  • Google Chrome Version: 120.0.6099.217 (Official Build) (64-bit)

Please note that while the code has been tested with these versions, newer versions of Anki or other dependencies may affect its functionality.

Example Ouput

example output example output

Troubleshooting

  • Duplicate Anki Cards Error
    • Delete the deck containing the duplicates and try again
  • OSError upon finishing program execution
    • Comment out time.sleep(0.1) on line 798 of venv\Lib\site-packages\undetected_chromedriver\__init__.py

Disclaimer

I am not responsible for any misuse of this code. Please respect the websites and their terms.

leetcode-anki-script's People

Contributors

roblieblang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.