leetcode-study-tool


Nameleetcode-study-tool JSON
Version 1.3 PyPI version JSON
download
home_page
SummaryA tool for studying Leetcode with Python
upload_time2024-02-06 17:39:53
maintainer
docs_urlNone
author
requires_python
licenseMIT License Copyright (c) 2023 John Sutor 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. 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.
keywords leetcode leet study anki
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # 💻 Leetcode Study Tool
![Tests Status](https://github.com/johnsutor/leetcode-study-tool/workflows/Tests/badge.svg)
![Style Status](https://github.com/johnsutor/leetcode-study-tool/workflows/Style/badge.svg)
[![Python Versions](https://img.shields.io/pypi/pyversions/leetcode-study-tool)](https://pypi.org/project/leetcode-study-tool/)
[![PyPi](https://img.shields.io/pypi/v/leetcode-study-tool)](https://pypi.org/project/leetcode-study-tool/)
![contributions welcome](https://img.shields.io/badge/contributions-welcome-blue.svg?style=flat)

![Leetcode Study Tool Diagram](./static/leetcode_study_tool_diagram.png)

This package lets you get grokking as quickly as possible with Leetcode. It provides a command-line tool for interracting with Leetcode to create either an Excel file or Anki flashcards for study. Currently, this tool supports taking in a list of leetcode question slugs or URLs or popular study sets (including the [Blind 75](https://www.teamblind.com/post/New-Year-Gift---Curated-List-of-Top-75-LeetCode-Questions-to-Save-Your-Time-OaM1orEU), [Grind 75](https://www.techinterviewhandbook.org/grind75), and [Neetcode 150](https://neetcode.io/practice)). 

## 🤔 Why? 
This package was created as an opinionated alternative to other existing packages (as listed at the bottom of this README). 

## 📥 Installation
```shell
$ pip install leetcode-study-tool
```

## 💻 Usage 
```shell
usage: leetcode-study-tool [-h]
                           (--url URL | --file FILE | --preset {blind_75,grind_75,grind_169,neetcode_150,neetcode_all})
                           [--format {anki,excel}] [--csrf CSRF] [--output OUTPUT]
                           [--language LANGUAGE]

Generates problems from LeetCode questions in a desired format.

options:
  -h, --help            show this help message and exit
  --url URL, -u URL     The URL(s) or slug(s) of the LeetCode question(s) to generate
                        problem(s) for. (default: None)
  --file FILE, -f FILE  The file containing the URL(s) or slug(s) of the LeetCode question(s)
                        to generate problem(s) for. (default: None)
  --preset {blind_75,grind_75,grind_169,neetcode_150,neetcode_all}, -p {blind_75,grind_75,grind_169,neetcode_150,neetcode_all}
                        The preset to use to generate problem(s) for. (default: None)
  --format {anki,excel}, -F {anki,excel}
                        The format to save the Leetcode problem(s) in. (default: anki)
  --csrf CSRF, -c CSRF  The CSRF token to use for LeetCode authentication. (default: None)
  --output OUTPUT, -o OUTPUT
                        The output file to write the problem(s) to. (default: output.txt)
  --language LANGUAGE, -l LANGUAGE
                        The language to generate problem(s) for. (default: None)
```

## 💡 Example 
In the simplest case, if you want to [Grok](https://www.reddit.com/r/leetcode/comments/t5xqb6/how_to_use_grokking/) the most commonly asked questions, you should generate from a preset. For example, generating Anki cards from the [Grind 75](https://www.techinterviewhandbook.org/grind75) is as simple as 
```shell
$ leetcode-study-tool -p grind_75
```
Perhaps, instead, you'd prefer to import questions that you've already worked on. In a directory with a file named `questions.txt`, where each line is either a Leetcode problem URL or slug (or a combination of both), we can run the command 
```shell
$ leetcode-study-tool -f questions.txt 
```
which will generate the file `output.txt`. We can then open Anki to import these problems as demonstrated below, *ensuring to select semicolon as a field separator*.

![anki demo](static/anki-demo.gif)

## 📒 Anki
When generating an Anki output, the resulting "cards" are saved as a `.txt` file. These cards include three fields:
1. The front of the study card, containing the question ID, Title, URL, and problem description 
2. The publicly available solutions (and NeetCode solution, if available)
3. The tags associated with the problem (i.e., if the problem involves a hash map, arrays, etc...)

## 📊 Excel
When generating an Excel output, the resulting questions are saved in an `.xlsx` file. Each problem includes the following fields:
1. ID of the leetcode question
2. Title of the leetcode question
3. URL of the leetcode question
4. Last date that this question was attempted by the user (please note that this is not pulled from your leetcode profile, but left for you to update as you progress in solving leetcode questions)
5. The tags associated with the problem (i.e., if the problem involves a hash map, arrays, etc...)
6. Neetcode video link (if it exists)
7. Solution links for the problem (if they are reachable)
8. Companies that have asked this question recently in interviews (if they are reachable)

## 🛣 Roadmap 
- [X] Use TQDM to show card generation progress
- [X] Add support for exporting to an excel sheet
- [X] Add support for showing neetcode solutions on the back of the card as a 
- [ ] Add support for getting the difficulty of questions 
- [ ] Add support for fetching premium questions via authentification
- [ ] Add support for importing cards into Quizlet
- [ ] Add support for fetching questions by topic or tag 
link
- [ ] Allow for the definition of custom formatters and outputs (including which fields are included or excluded)
- [ ] Reach 90% test coverage

## 🔎 Other Usefull Stuff
- [Remember anything with Anki](https://foggymountainpass.com/anki-essentials/)
- [Leetcode Anki Card Generator](https://github.com/fspv/leetcode-anki)
- [Leetcode API](https://github.com/fspv/python-leetcode)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "leetcode-study-tool",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "leetcode,leet,study,Anki",
    "author": "",
    "author_email": "John Sutor <johnsutor3@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/21/ac/61a67641aa4e02a27b32cf03af8742f29b8619bce45cdb423aa8b570f6fe/leetcode-study-tool-1.3.tar.gz",
    "platform": null,
    "description": "# \ud83d\udcbb Leetcode Study Tool\n![Tests Status](https://github.com/johnsutor/leetcode-study-tool/workflows/Tests/badge.svg)\n![Style Status](https://github.com/johnsutor/leetcode-study-tool/workflows/Style/badge.svg)\n[![Python Versions](https://img.shields.io/pypi/pyversions/leetcode-study-tool)](https://pypi.org/project/leetcode-study-tool/)\n[![PyPi](https://img.shields.io/pypi/v/leetcode-study-tool)](https://pypi.org/project/leetcode-study-tool/)\n![contributions welcome](https://img.shields.io/badge/contributions-welcome-blue.svg?style=flat)\n\n![Leetcode Study Tool Diagram](./static/leetcode_study_tool_diagram.png)\n\nThis package lets you get grokking as quickly as possible with Leetcode. It provides a command-line tool for interracting with Leetcode to create either an Excel file or Anki flashcards for study. Currently, this tool supports taking in a list of leetcode question slugs or URLs or popular study sets (including the [Blind 75](https://www.teamblind.com/post/New-Year-Gift---Curated-List-of-Top-75-LeetCode-Questions-to-Save-Your-Time-OaM1orEU), [Grind 75](https://www.techinterviewhandbook.org/grind75), and [Neetcode 150](https://neetcode.io/practice)). \n\n## \ud83e\udd14 Why? \nThis package was created as an opinionated alternative to other existing packages (as listed at the bottom of this README). \n\n## \ud83d\udce5 Installation\n```shell\n$ pip install leetcode-study-tool\n```\n\n## \ud83d\udcbb Usage \n```shell\nusage: leetcode-study-tool [-h]\n                           (--url URL | --file FILE | --preset {blind_75,grind_75,grind_169,neetcode_150,neetcode_all})\n                           [--format {anki,excel}] [--csrf CSRF] [--output OUTPUT]\n                           [--language LANGUAGE]\n\nGenerates problems from LeetCode questions in a desired format.\n\noptions:\n  -h, --help            show this help message and exit\n  --url URL, -u URL     The URL(s) or slug(s) of the LeetCode question(s) to generate\n                        problem(s) for. (default: None)\n  --file FILE, -f FILE  The file containing the URL(s) or slug(s) of the LeetCode question(s)\n                        to generate problem(s) for. (default: None)\n  --preset {blind_75,grind_75,grind_169,neetcode_150,neetcode_all}, -p {blind_75,grind_75,grind_169,neetcode_150,neetcode_all}\n                        The preset to use to generate problem(s) for. (default: None)\n  --format {anki,excel}, -F {anki,excel}\n                        The format to save the Leetcode problem(s) in. (default: anki)\n  --csrf CSRF, -c CSRF  The CSRF token to use for LeetCode authentication. (default: None)\n  --output OUTPUT, -o OUTPUT\n                        The output file to write the problem(s) to. (default: output.txt)\n  --language LANGUAGE, -l LANGUAGE\n                        The language to generate problem(s) for. (default: None)\n```\n\n## \ud83d\udca1 Example \nIn the simplest case, if you want to [Grok](https://www.reddit.com/r/leetcode/comments/t5xqb6/how_to_use_grokking/) the most commonly asked questions, you should generate from a preset. For example, generating Anki cards from the [Grind 75](https://www.techinterviewhandbook.org/grind75) is as simple as \n```shell\n$ leetcode-study-tool -p grind_75\n```\nPerhaps, instead, you'd prefer to import questions that you've already worked on. In a directory with a file named `questions.txt`, where each line is either a Leetcode problem URL or slug (or a combination of both), we can run the command \n```shell\n$ leetcode-study-tool -f questions.txt \n```\nwhich will generate the file `output.txt`. We can then open Anki to import these problems as demonstrated below, *ensuring to select semicolon as a field separator*.\n\n![anki demo](static/anki-demo.gif)\n\n## \ud83d\udcd2 Anki\nWhen generating an Anki output, the resulting \"cards\" are saved as a `.txt` file. These cards include three fields:\n1. The front of the study card, containing the question ID, Title, URL, and problem description \n2. The publicly available solutions (and NeetCode solution, if available)\n3. The tags associated with the problem (i.e., if the problem involves a hash map, arrays, etc...)\n\n## \ud83d\udcca Excel\nWhen generating an Excel output, the resulting questions are saved in an `.xlsx` file. Each problem includes the following fields:\n1. ID of the leetcode question\n2. Title of the leetcode question\n3. URL of the leetcode question\n4. Last date that this question was attempted by the user (please note that this is not pulled from your leetcode profile, but left for you to update as you progress in solving leetcode questions)\n5. The tags associated with the problem (i.e., if the problem involves a hash map, arrays, etc...)\n6. Neetcode video link (if it exists)\n7. Solution links for the problem (if they are reachable)\n8. Companies that have asked this question recently in interviews (if they are reachable)\n\n## \ud83d\udee3 Roadmap \n- [X] Use TQDM to show card generation progress\n- [X] Add support for exporting to an excel sheet\n- [X] Add support for showing neetcode solutions on the back of the card as a \n- [ ] Add support for getting the difficulty of questions \n- [ ] Add support for fetching premium questions via authentification\n- [ ] Add support for importing cards into Quizlet\n- [ ] Add support for fetching questions by topic or tag \nlink\n- [ ] Allow for the definition of custom formatters and outputs (including which fields are included or excluded)\n- [ ] Reach 90% test coverage\n\n## \ud83d\udd0e Other Usefull Stuff\n- [Remember anything with Anki](https://foggymountainpass.com/anki-essentials/)\n- [Leetcode Anki Card Generator](https://github.com/fspv/leetcode-anki)\n- [Leetcode API](https://github.com/fspv/python-leetcode)\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 John Sutor  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.  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.",
    "summary": "A tool for studying Leetcode with Python",
    "version": "1.3",
    "project_urls": {
        "changelog": "https://github.com/johnsutor/leetcode-study-tool/blob/main/CHANGELOG.md",
        "homepage": "https://github.com/johnsutor/leetcode-study-tool",
        "repository": "https://github.com/johnsutor/leetcode-study-tool"
    },
    "split_keywords": [
        "leetcode",
        "leet",
        "study",
        "anki"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "04dccef759233b223bf18d22564fcc81fb21b1fe0d13c7a12b46754b014a8e45",
                "md5": "ab5cbd4c7b8e1dec68f060fc0a34e8a6",
                "sha256": "71c20f0189005b46bb422a2d881563cab91a9e6f6a76c05e1bf1a0bc52066ef0"
            },
            "downloads": -1,
            "filename": "leetcode_study_tool-1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ab5cbd4c7b8e1dec68f060fc0a34e8a6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 28856,
            "upload_time": "2024-02-06T17:39:52",
            "upload_time_iso_8601": "2024-02-06T17:39:52.023025Z",
            "url": "https://files.pythonhosted.org/packages/04/dc/cef759233b223bf18d22564fcc81fb21b1fe0d13c7a12b46754b014a8e45/leetcode_study_tool-1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "21ac61a67641aa4e02a27b32cf03af8742f29b8619bce45cdb423aa8b570f6fe",
                "md5": "eaa081ffe9c19256a31fa16f1cc53491",
                "sha256": "fe88e22db77b92f01b0d09a0f1c3f618c45b8fa1f4e06495a723d5e3dabfefd7"
            },
            "downloads": -1,
            "filename": "leetcode-study-tool-1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "eaa081ffe9c19256a31fa16f1cc53491",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 32856,
            "upload_time": "2024-02-06T17:39:53",
            "upload_time_iso_8601": "2024-02-06T17:39:53.746880Z",
            "url": "https://files.pythonhosted.org/packages/21/ac/61a67641aa4e02a27b32cf03af8742f29b8619bce45cdb423aa8b570f6fe/leetcode-study-tool-1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-06 17:39:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "johnsutor",
    "github_project": "leetcode-study-tool",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "leetcode-study-tool"
}
        
Elapsed time: 0.17722s