A Python package to generate professional LeetCode practice environments: a problem README, a typed solution stub, a parametrized pytest suite with 10+ cases, helpers, and a playground notebook, all from JSON templates. Full documentation lives at leetcode-py.wisl.dev.
What makes this different:
- 🤖 LLM-Assisted Workflow: Generate new problems instantly with AI assistance
- 🎨 Visual Debugging: TreeNode, ListNode, and GraphNode render as Graphviz diagrams in Jupyter and clean ASCII in the terminal
- 🧪 Production Testing: Comprehensive test suites with edge cases and reproducibility verification
- 🚀 Modern Python: PEP 585/604 type hints, uv, and professional tooling
- 📊 Quality Assurance: 95%+ test coverage, security scanning, automated linting
- ⚡ Powerful CLI: Generate problems anywhere with
lcpycommand
Requires Python 3.10+ and Graphviz for visualizations (install guide).
# Install the package
pip install leetcode-py-sdk
# Generate problems anywhere
lcpy gen -n 1 # Generate Two Sum
lcpy gen -t grind-75 # Generate all Grind 75 problems
lcpy list -t blind-75 # List Blind 75 problems
# Start practicing
cd leetcode/two_sum
python -m pytest test_solution.py # Run tests
# Edit solution.py, then rerun testsSee the Quickstart for the full walkthrough and the CLI guide for every option.
531 problems, ready to generate, across seven complete collections. Browse them all in the [catalog](https://leetcode-py.wisl.dev/catalog):| Collection | What it is |
|---|---|
| Grind 75 | Essential coding interview questions, time-boxed study plan |
| Grind | 169 problems; Grind 75 plus the extended edition |
| Blind 75 | The original curated list |
| NeetCode 150 | Comprehensive coverage by topic |
| NeetCode 250 | NeetCode 150 plus 100 more |
| NeetCode All | The complete neetcode.io list; coverage still growing |
| AlgoMaster 75 | Curated algorithmic mastery problems |
git clone https://github.com/wislertt/leetcode-py.git
cd leetcode-py
uv sync
bake testProblems in leetcode/ are generated from JSON templates. To add one, use the LLM-assisted workflow; for repo tasks see the bakefile guide.
- Why leetcode-py
- Installation
- Problem anatomy
- Testing pattern
- Visualizations
- Notebook workflow
- CLI reference
- Contributing
If you find this project helpful, please consider starring the repo ⭐ or sponsoring my work 💖.
Apache-2.0. See LICENSE.