Giter VIP home page Giter VIP logo

leetcode-anki's Introduction

介绍

在刷LeetCode的过程中时常会遇到与之前类似的题目但是却忘记解题思路的情况。Anki 是一个基于遗忘曲线的全平台记忆工具,支持Mac,Linux, Windows, iOS和Andorid平台。Anki是一个优秀的记忆工具,但是在使用需要手动制卡,这个过程非常繁琐且耗时。

Invest some time to automate or simplify a process to save more time in the future

本项目旨在抓取LeetCode已AC的题目,并自动生成Anki卡组帮助记忆。

抓取的数据包括:

  1. 题目标题,难度,描述。
  2. 官方题解(Premium的题解需要订阅才能抓取)。
  3. 用户AC的提交代码。

DEMO

正面 背面
front back

示例卡组

使用

首先Clone仓库并安装Python依赖

git clone https://github.com/Peng-YM/LeetCode-Anki.git
cd LeetCode-Anki
pip3 install -r requirements.txt

运行爬虫并输出Anki卡组到./data/LeetCode.apkg (由project.conf指定)。

python3 main.py

增加对Leetcode.cn的支持

python3 main_cn.py

首次运行需要获取cookie,运行main.py会打开一个Chrome窗口, 手动填写用户名和密码登陆一次即可。

⚠️ 注意:

  1. 如果需要重新浏览器登陆,只需要删除目录下的cookie.dat即可。
  2. 如果浏览器的驱动过期(目前为V86.0),请前往下载Chrome的Selenium驱动 并替换vendor的旧驱动。

愉快使用Anki复习做过的题目吧。

自定义

如果你不喜欢默认生成的Anki卡片样式,你可以修改project.conf里面的以下三个参数,自定义生成的Anki卡片。

[DB]
path = ./data
debug = False

[Anki]
front = ./templates/front-side.html
back = ./templates/back-side.html
css = ./templates/style.css
output = ./data/LeetCode.apkg
  • front: 卡片正面的格式。
  • back: 卡片背面的格式。
  • css: 卡片的css样式。

LICENSE

本项目基于GPL V3开源协议。

Acknowledgements

本项目基于众多优秀的开源项目:

leetcode-anki's People

Contributors

keniushadu avatar louischerry avatar mx-in avatar npes87184 avatar peng-ym 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.