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
307 problems, ready to generate, across six complete collections. Browse them all in the 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 |
| 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.4
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.4.tar.gz | 252.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| leetcode_py_sdk-1.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 796.5 kB
Release files / leetcode_py_sdk-1.0.4.tar.gz
| Download URL | leetcode_py_sdk-1.0.4.tar.gz |
|---|---|
| Size | 252.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2511b25696ae817b296ca798cc2f5b321b6a61e5438cf3db1efcec43b5ddc154
|
|
BLAKE2b-256 checksum How to use checksums |
70b6e0f3a4da69e22025321f19cd8ae0285719102ef0697e06c157be588fd3e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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.4-py3-none-any.whl
| Download URL | leetcode_py_sdk-1.0.4-py3-none-any.whl |
|---|---|
| Size | 543.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
757bdf7c71225e56d90bbe2f90ebf0154f87a927b969e8fb9e6819ff99151a25
|
|
BLAKE2b-256 checksum How to use checksums |
bdae7b3a4c1967af8d93fd45ddb825633d2f45924bb6d7286471755303a541e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}
|