{"id":28749264,"url":"https://github.com/scarowar/scars-of-leetcode","last_synced_at":"2026-04-18T09:32:07.018Z","repository":{"id":299064266,"uuid":"998502395","full_name":"scarowar/scars-of-leetcode","owner":"scarowar","description":"Automation-driven LeetCode workflow with solutions, spaced-repetition flashcards, and Anki integration.","archived":false,"fork":false,"pushed_at":"2025-07-29T14:52:51.000Z","size":539,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-03T14:16:45.189Z","etag":null,"topics":["algorithms","anki","automation","coding-interviews","flashcards","interview-preparation","leetcode","neetcode150","open-source","python","spaced-repetition"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scarowar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-08T18:39:08.000Z","updated_at":"2025-07-28T17:47:49.000Z","dependencies_parsed_at":"2025-06-14T13:21:33.204Z","dependency_job_id":"4ec0dae0-8490-4b27-8e52-cecba2c73cee","html_url":"https://github.com/scarowar/scars-of-leetcode","commit_stats":null,"previous_names":["scarowar/scars-of-leetcode"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scarowar/scars-of-leetcode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scarowar%2Fscars-of-leetcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scarowar%2Fscars-of-leetcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scarowar%2Fscars-of-leetcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scarowar%2Fscars-of-leetcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scarowar","download_url":"https://codeload.github.com/scarowar/scars-of-leetcode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scarowar%2Fscars-of-leetcode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31963966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","anki","automation","coding-interviews","flashcards","interview-preparation","leetcode","neetcode150","open-source","python","spaced-repetition"],"created_at":"2025-06-16T20:01:29.378Z","updated_at":"2026-04-18T09:32:07.000Z","avatar_url":"https://github.com/scarowar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scars of LeetCode\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE)\n[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/scarowar/scars-of-leetcode)\n[![pre-commit](https://github.com/scarowar/scars-of-leetcode/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/scarowar/scars-of-leetcode/actions/workflows/pre-commit.yml)\n[![CodeQL](https://github.com/scarowar/scars-of-leetcode/actions/workflows/codeql.yml/badge.svg)](https://github.com/scarowar/scars-of-leetcode/actions/workflows/codeql.yml)\n[![Dependabot Status](https://img.shields.io/badge/dependabot-enabled-brightgreen?logo=dependabot)](https://github.com/scarowar/scars-of-leetcode/pulls?q=is%3Apr+label%3Adependencies)\n\n**Every Accepted was paid in blood, sweat, and runtime errors.**\n\n\u003e **Note:** This repository is a work in progress. Expect ongoing improvements and refinements!\n\n## Table of Contents\n\n* [Overview](#overview)\n* [Features](#features)\n* [Installation](#installation)\n* [The Workflow: A Quick Start](#the-workflow-a-quick-start)\n* [Command Usage](#command-usage)\n* [Configuration](#configuration)\n* [File \u0026 Folder Structure](#file--folder-structure)\n* [Contributing \u0026 Support](#contributing--support)\n* [License](#license)\n* [OpenAI API Usage (Optional)](#openai-api-usage-optional)\n\n## Overview\n\n**Scars of LeetCode** is a repository powered by **Scarleet**, a command-line tool designed to automate and streamline the entire workflow for mastering LeetCode problems. It helps you:\n\n* Organize solutions in a structured way.\n* Automatically generate high-quality documentation for solved problems.\n* Create evidence-based, spaced-repetition flashcards for deep learning.\n* Track your progress with a dynamic summary table.\n* Seamlessly integrate with Anki for efficient review.\n\nThis project is for anyone who wants to build a deep, recallable understanding of algorithms and data structures through a powerful, automated system.\n\n## Features\n\n* **CLI-Driven Workflow**: Manage your entire practice from the command line.\n* **Automated Scaffolding**: Instantly create a structured directory for any LeetCode problem.\n* **AI-Powered Documentation**: Use a local language model to automatically generate high-quality READMEs explaining your solution's intuition, approach, and complexity.\n* **Automated Flashcard Generation**: Turn your solutions into effective Anki flashcards (both Q\u0026A and Cloze deletion) with a single command.\n* **Intelligent Anki Integration**: Automatically detects your environment (including WSL) to connect to Anki and sync cards without manual configuration.\n* **Progress Tracking**: Generate a summary table of your progress at any time.\n\n## Installation\n\n**Prerequisites:**\n\n* Python 3.8+\n* [Ollama](https://ollama.com/) for running the local language model.\n* [Anki](https://apps.ankiweb.net/) desktop application with the [AnkiConnect](https://ankiweb.net/shared/info/2055492159) add-on installed.\n\n**Setup Steps:**\n\n1.  Clone the repository:\n    ```sh\n    git clone [https://github.com/scarowar/scars-of-leetcode.git](https://github.com/scarowar/scars-of-leetcode.git)\n    cd scars-of-leetcode\n    ```\n2.  Install the required Python packages:\n    ```sh\n    pip install \"typer[all]\" rich toml requests\n    ```\n3.  Run the interactive setup command. This will create your configuration file, check for Ollama, and download the recommended language model.\n    ```sh\n    python main.py setup\n    ```\n\n## Installation (Local CLI)\n\nYou can install all dependencies with either:\n\n```sh\npip install -r requirements.txt\n```\n\nor, if you prefer PEP 621/modern Python packaging:\n\n```sh\npip install .\n```\n\nBoth methods will install all required packages for Scarleet.\n\nSee [INSTALL.md](INSTALL.md) for more details.\n\n## The Workflow: A Quick Start\n\nThe entire process is designed to be simple and flow naturally with your practice.\n\n1.  **Create a New Problem:**\n    ```sh\n    scarleet new \u003cproblem-slug\u003e\n    # Example: scarleet new two-sum\n    ```\n2.  **Solve It:** Navigate to the new `problems/[id]-[slug]` directory and write your solution in `solution.py`.\n3.  **Generate Docs:** After your solution is accepted on LeetCode, let Scarleet document it for you.\n    ```sh\n    scarleet docgen \u003cproblem-slug\u003e\n    ```\n4.  **Create Flashcards:** Turn your documented solution into study material.\n    ```sh\n    scarleet flashcards \u003cproblem-slug\u003e\n    ```\n5.  **Track Your Progress:** View a summary of all your solved problems and update the master `README.md`.\n    ```sh\n    scarleet status --update-readme\n    ```\n\n## Command Usage\n\n* **`setup`**: Initializes the project. Should be run once.\n* **`new \u003cslug\u003e`**: Scaffolds a new problem directory.\n* **`docgen \u003cslug\u003e`**: Generates a `README.md` for a problem using your solution and the local SLM.\n* **`flashcards \u003cslug\u003e`**: Generates Anki flashcards from your `README.md` and solution.\n* **`status`**: Displays a summary table of all problems. Use the `--update-readme` or `-u` flag to write this table to `problems/README.md`.\n\n## Configuration\n\nAll configuration is managed in the `scarleet.toml` file, which is created by the `setup` command. Here you can change:\n\n* The language model used (e.g., from `gemma:2b` to another Ollama model).\n* The prompts used for generating documentation and flashcards.\n* The name of your Anki deck.\n\n## File \u0026 Folder Structure\n\n```\n.\n├── scarleet.toml        # Global configuration for the tool\n├── main.py              # The CLI entrypoint\n├── commands/            # Logic for each CLI command\n├── core/                # Core logic for Anki, SLM, and LeetCode API\n├── problems/\n│   ├── ...              # One folder per problem, each with solution and docs\n│   └── README.md        # Auto-generated progress summary\n└── .scarleet/\n    └── lists/\n        ├── blind75.json         # Blind 75 list\n        └── neetcode150.json     # NeetCode 150 list\n```\n\n\n## OpenAI or Azure OpenAI Usage (Optional)\n\nScarleet can use either OpenAI or Azure OpenAI models (like GPT-4, GPT-3.5, etc.) for generating flashcards and documentation. To enable this, set the following environment variables in a `.env` file (which should NOT be committed to version control):\n\n### For OpenAI:\n```\nOPENAI_API_KEY=sk-...your-key...\nOPENAI_API_URL=https://api.openai.com/v1\nOPENAI_MODEL=gpt-4o\nOPENAI_API_VERSION=2024-06-01\n```\n\n### For Azure OpenAI:\n```\nAZURE_API_KEY=your-azure-key\nAZURE_API_BASE=https://your-resource.openai.azure.com\nAZURE_DEPLOYMENT_NAME=your-deployment\nAZURE_API_VERSION=2024-06-01\n```\n\n- Scarleet will auto-detect which provider to use based on your `.env`.\n- If neither is set, Scarleet will use your local SLM endpoint as a fallback.\n- Install dependencies for .env support:\n  ```sh\n  pip install python-dotenv\n  ```\n- The `openai` Python package is required (see `requirements.txt`).\n\n**Never commit your `.env` file or API keys to version control.**\n\n---\n\n## Contributing \u0026 Support\n\nContributions, suggestions, and improvements are welcome! Please open an issue or PR. By contributing, you agree that your contributions will be licensed under the GNU General Public License v3.0.\n\n## License\n\nThis project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.\n\n**Happy grinding — and may your scars become your strength!**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscarowar%2Fscars-of-leetcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscarowar%2Fscars-of-leetcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscarowar%2Fscars-of-leetcode/lists"}