{"id":21889234,"url":"https://github.com/alirezadir/leetcode-summerizer","last_synced_at":"2025-06-26T21:33:27.402Z","repository":{"id":211837697,"uuid":"729970851","full_name":"alirezadir/leetcode-summerizer","owner":"alirezadir","description":"Summarize and collect into a DB a collection of LeetCode problems (Description, Solutions, Code, Analysis)","archived":false,"fork":false,"pushed_at":"2023-12-11T15:14:50.000Z","size":48,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T12:48:09.514Z","etag":null,"topics":["ai","artificial-intelligence","code-summarization","leetcode","machinelearning","openai-gpt","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alirezadir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-10T22:35:41.000Z","updated_at":"2025-03-27T18:49:14.000Z","dependencies_parsed_at":"2025-01-26T20:40:20.885Z","dependency_job_id":null,"html_url":"https://github.com/alirezadir/leetcode-summerizer","commit_stats":null,"previous_names":["alirezadir/leetcode-summerizer"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/alirezadir/leetcode-summerizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alirezadir%2Fleetcode-summerizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alirezadir%2Fleetcode-summerizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alirezadir%2Fleetcode-summerizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alirezadir%2Fleetcode-summerizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alirezadir","download_url":"https://codeload.github.com/alirezadir/leetcode-summerizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alirezadir%2Fleetcode-summerizer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262145188,"owners_count":23265886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ai","artificial-intelligence","code-summarization","leetcode","machinelearning","openai-gpt","python"],"created_at":"2024-11-28T11:20:44.210Z","updated_at":"2025-06-26T21:33:27.381Z","avatar_url":"https://github.com/alirezadir.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Leetcode-Summarizer 1.0\nSummarize and collect into a DB a collection of LeetCode problems (Description, Solutions, Code, Analysis)\n\n## 📣 News\n\n- My new e-book 📚  **LLMs: An Intro and System Design (2023 Edition)** will appear soon (by this Christmas 🎄, will be brought by Santa 🎅). \n  - It will cover the foundations of LLMs, LLMs System Design,  and Latest Tools and Updates in Generative AI technology.\n  - Stay tuned! 🎁\n\n# 🚀 AI-Powered LeetCode Problem Summarizer\n\nThis project harnesses the power of OpenAI's GPT models to summarize LeetCode problems, making interview preparation more efficient and engaging. Whether you're gearing up for a big interview or just brushing up on your coding skills, this tool is your go-to assistant!\n\n## 🌟 Features\n\n- Summarizes LeetCode problems using OpenAI's GPT models.\n- Efficient batch processing of problems.\n- Easy-to-use command-line interface.\n- Outputs stored neatly in CSV format.\n\n## 📚 Setup Instructions\n\n1. **Get OpenAI API Access:**\n   - You'll need access to OpenAI's API. Check out [OpenAI's Platform](https://openai.com/api/) for subscription details and how to obtain API credits.\n\n2. **Clone the Repository:**\n   - `git clone https://github.com/your-username/leetcode-summarizer.git`\n   - Navigate to the repository directory: `cd leetcode-summarizer`\n\n3. **Install Required Python Packages:**\n   - Make sure you have Python installed on your system.\n   - Install necessary packages: `pip install requests pandas`\n\n4. **Set Up Your API Key:**\n   - Store your OpenAI API key as an environment variable for security.\n   - In your terminal, set the API key: `export OPENAI_API_KEY='your_api_key_here'`\n\n5. **Running the Application:**\n   - Run the main script: `python main.py`\n   - Make sure you have your problem inputs ready in `prompt_arguments.csv`.\n\n6. **File Structure and Data Schemas:**\n   - `logs/app.log`: Logs all runtime information, including progress updates and errors. Data schema: Timestamp, Log Level, Message.\n   - `logs/prompts.log`: Stores detailed prompt templates used for each request. Data schema: Prompt Template, Problem.\n   - `prompt_arguments.csv`: Input file containing LeetCode problem descriptions. Should have a header named \"problem\" followed by rows containing individual problem descriptions or titles.\n\n### Open AI Platform Issues\n\n- **ChatGPT API Setup Challenges**\n  - **New API endpoint updates:**\n      - The current endpoint used in this code is \"https://api.openai.com/v1/chat/completions\".\n      - This endpoint is one of the options for both \"gpt-3.5-turbo\" (default in this code) and \"gpt-4\" models.\n      - Each endpoint supports only a certain class of models.\n      - Explore the latest \"endpoints\" and their compatible models in [Open AI's platform documentation](https://platform.openai.com/docs/models/model-endpoint-compatibility).\n  - **New format for request message (currently ChatML format).**\n  - **You have to upgrade to a paid account and add credits to your account:**\n      - There’s a known bug with the payment system. You may get the `Error 429 Too Many Requests` from Open AI Api while adding your payment method. You may need to install a VPN (as I did as the last solution) to get around this issue ([Link](https://techviral.net/chatgpt-error-429-too-many-requests/)), or wait for it to be resolved, hopefully soon!\n  - **You need to re-generate your Open AI key after upgrading the billing account and store the new API key in your bash_profile for use in the python code. Otherwise, you will get the error `404 Client Error: Not Found for url: https://api.openai.com/v1/completions`**.\n\n## 💻 Recommended Code Editor\n\n- Suggestion is using [Visual Studio Code](https://code.visualstudio.com/) for an enhanced coding experience with this project.\n\n## 🎶 A Fun Fact\n\n- 🎧: This README and the accompanying code were crafted while listening to some energetic techno beats! 🎶 Techno is love ❤️. \n  - \u003cimg src=\"imgs/soundlcloud.png\" alt=\"Alt text\" style=\"width: 15px; height: 15px;\"\u003e  Check out some of my DJ mixes (Organic House, Melodic House and Techno) [here on Soundcloud](https://soundcloud.com/alirezadir)!\n  - 🎧🎵 My current favorite track: [Simulation](https://open.spotify.com/playlist/3p52wFvY1hYMzjQJnkkfxW) *by \"Anyma \u0026 Chris Avantgarde\".*\n\n## 🙌 Credits\n\n- This project was created with assistance from my ChatGPT assistant, who was indispensable in writing the code and crafting this README.\n\n## 🌟 Gratitude \n\n- 🙏 I am deeply grateful for being where I am today and for the opportunity to share this work with you all. 🌍 It's been a long, challenging journey filled with excitement from the start to this point. I am thankful for all the gifts that the universe has brought to me, and I've discovered that living with gratitude is a profoundly transformative way of life. 🌈\n\n\u003e To speak gratitude is courteous and pleasant, to enact gratitude is generous and noble, but to live gratitude is to touch Heaven. – Johannes A. Gaertner (*German Art Historian, Professor of Art History*)\n\n- 🙏 Special thanks go to my very close friends who have always supported me throughout my journey. \n\n- 🙏 I am also eternally grateful to all my teachers who have guided me from the very beginning until now. Their wisdom and support have been invaluable.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falirezadir%2Fleetcode-summerizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falirezadir%2Fleetcode-summerizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falirezadir%2Fleetcode-summerizer/lists"}