https://github.com/anuranjanjain/leetcode-practice-tracker
I built this Python tool to make coding practice smoother & more organized. β¨ Key Features: π Daily Problem Organization π€ Automated Solution Explanations (AI-optional & offline modes!) π Progress Statistics & Streaks seamlessly direct to GitHub!
https://github.com/anuranjanjain/leetcode-practice-tracker
automation github openai python
Last synced: about 2 months ago
JSON representation
I built this Python tool to make coding practice smoother & more organized. β¨ Key Features: π Daily Problem Organization π€ Automated Solution Explanations (AI-optional & offline modes!) π Progress Statistics & Streaks seamlessly direct to GitHub!
- Host: GitHub
- URL: https://github.com/anuranjanjain/leetcode-practice-tracker
- Owner: AnuranjanJain
- Created: 2025-05-12T13:25:54.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-13T17:18:17.000Z (about 1 year ago)
- Last Synced: 2025-06-05T18:49:01.876Z (about 1 year ago)
- Topics: automation, github, openai, python
- Language: Python
- Homepage:
- Size: 74.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π LeetCode Practice Tracker
Welcome to the **LeetCode Practice Tracker**!
This tool helps you manage your LeetCode journey, track your progress, and maintain a beautifully organized repository of your solutionsβcomplete with auto-generated explanations and statistics.
---
## π Features
- **Add New Problems Easily:**
Add LeetCode problems by URL, interactively, or with manual details. The script fetches problem metadata automatically!
- **Organized by Day:**
Solutions are grouped by day, making it easy to track your daily progress and maintain streaks.
- **Auto-Generated Explanations:**
Get detailed, well-formatted markdown explanations for your solutionsβpowered by code analysis or OpenAI (if you have an API key).
- **Progress Dashboard:**
The main README and day-specific READMEs show your total problems solved, days completed, and difficulty breakdown.
- **Statistics & Streaks:**
View your current streak, longest streak, and a breakdown of problems by difficulty.
- **Header Standardization:**
Automatically update and standardize headers in all your solution files.
- **GitHub Integration:**
Commit and push your progress to GitHub with a single command.
- **Customizable AI Service:**
Choose between local (free) code analysis or OpenAI for generating explanations.
---
## π¦ Directory Structure
```
.
βββ update_leetcode.py # Main script
βββ readme.md # Main progress dashboard (auto-generated)
βββ practice/
βββ day_1/
β βββ two_sum.py
β βββ two_sum.md
β βββ README.md
βββ day_2/
β βββ ...
β βββ README.md
βββ ...
```
- Each `day_X` folder contains your solutions and explanations for that day.
- Each day has its own `README.md` summarizing the problems solved.
---
## π οΈ How to Use
1. **Run the Script:**
```bash
python update_leetcode.py
```
This launches an interactive menu.
2. **Menu Options:**
- Add new problems (by URL, interactively, or manually)
- Update all solution headers
- Rebuild the main README
- View statistics
- Generate or regenerate explanations
- Generate day-specific READMEs
- Configure API keys (for OpenAI)
- Select AI service (local or OpenAI)
- Upload your progress to GitHub
3. **Adding Problems:**
- Enter the LeetCode URL or details as prompted.
- The script fetches the problem name, difficulty, and creates a solution file with a standardized header.
4. **Generating Explanations:**
- Explanations are generated for each solution, either using local code analysis or OpenAI (if configured).
- Markdown files are created alongside your solution files.
5. **Uploading to GitHub:**
- Use the menu to commit and push your changes directly to your repository.
---
## π€ AI-Powered Explanations
- **Local (Free):**
Uses rule-based code analysis to generate detailed explanations, including approach, steps, complexity, alternatives, and insights.
- **OpenAI (Optional):**
If you have an OpenAI API key, you can generate even richer explanations using GPT models.
---
## π Example Statistics Output
```
Total Days: 10
Total Problems: 25
Current Streak: 5 days
Longest Streak: 7 days
Difficulty Breakdown:
- Easy: 8 (32.0%)
- Medium: 13 (52.0%)
- Hard: 4 (16.0%)
```
---
## π API Key Configuration
- For OpenAI explanations, set your API key as an environment variable:
- **Windows:** `set OPENAI_API_KEY=your-api-key`
- **Linux/Mac:** `export OPENAI_API_KEY=your-api-key`
- You can also configure this interactively via the menu.
---
## π‘ Why Use This Tracker?
- **Stay Consistent:**
Build and maintain your LeetCode streak with daily tracking.
- **Learn Effectively:**
Each solution is paired with a clear, structured explanation.
- **Showcase Your Progress:**
Auto-generated READMEs make your repository a great portfolio piece.
- **Automate the Boring Stuff:**
Focus on solving problemsβlet the script handle organization and documentation.
---
## π License
This project is open-source and free to use.
Created with β€οΈ by [AnuranjanJain](github.com/Anuranjanjain).
---
## π Happy Coding & Keep Crushing LeetCode!