leetcode-py
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
🚀 Quick Start
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 tests
See the Quickstart for the full walkthrough and the CLI guide for every option.
🗂️ Collections
1404 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 |
🛠️ Development
git clone https://github.com/wislertt/leetcode-py.git
cd leetcode-py
uv sync
bake test
Problems in leetcode/ are generated from JSON templates. To add one, use the LLM-assisted workflow; for repo tasks see the bakefile guide.
📖 Documentation
- Why leetcode-py
- Installation
- Problem anatomy
- Testing pattern
- Visualizations
- Notebook workflow
- CLI reference
- Contributing
💖 Support This Project
If you find this project helpful, please consider starring the repo ⭐ or sponsoring my work 💖.
License
Apache-2.0. See LICENSE.
Release files for leetcode-py-sdk 1.0.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| leetcode_py_sdk-1.0.12.tar.gz | 1.2 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| leetcode_py_sdk-1.0.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.7 MB
Release files / leetcode_py_sdk-1.0.12.tar.gz
| Download URL | leetcode_py_sdk-1.0.12.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
58521c0558f3e88df9970ed430dab3ec98c60852eceb30cb7bd9597563355cc2
|
|
BLAKE2b-256 checksum How to use checksums |
9ba3418d19785586d8f7eef36a9646a27a0fbf4cec3fa6614a605b7074a525ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / leetcode_py_sdk-1.0.12-py3-none-any.whl
| Download URL | leetcode_py_sdk-1.0.12-py3-none-any.whl |
|---|---|
| Size | 2.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
14a0e88b4cbfb37a380e2ad54e4e250a608cf8926dc7b7d28a9068b7e1377343
|
|
BLAKE2b-256 checksum How to use checksums |
1c05807f0b8b935ae3e58f6e9a2f1499daef5a53f57620061c95cb88bc8fb614
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|