# PyLeetPatterns
Master 14 essential algorithmic patterns with drop-in Python implementations for LeetCode and coding interviews.
### Production
```bash
pip install . # This installs the package normally into your Python environment.
```
## Development
### Setup
```bash
git clone https://github.com/yourusername/pyleetpatterns.git
cd pyleetpatterns
python3 -m venv .venv
source .venv/bin/activate
pip install -e . # This installs the package in "editable" mode, so changes tothe code are immediately reflected without reinstalling.
# or
pip install -e ".[dev]" # This installs the package in editable mode along with development tools (pytest, black, flake8, mypy).
```
The [dev] packages are already defined in the setup.py
file. Look at lines 30-37:
```py
extras_require={
"dev": [
"pytest>=7.0",
"black>=22.0",
"flake8>=4.0",
"mypy>=0.900",
]
},
```
This extras_require section in setup.py defines optional
dependencies. When you run:
```bash
pip install -e ".[dev]"
```
It will install:
1. The package itself in editable mode (-e .)
2. PLUS all the packages listed under the "dev" key:
- pytest (for testing)
- black (for code formatting)
- flake8 (for linting)
- mypy (for type checking)
You can add more development dependencies to this list if
needed. For example:
```py
extras_require={
"dev": [
"pytest>=7.0",
"black>=22.0",
"flake8>=4.0",
"mypy>=0.900",
"ipython>=8.0", # for interactive debugging
"pre-commit>=2.0", # for git hooks
]
},
```
You could also define other optional dependency groups like:
```py
extras_require={
"dev": [...],
"docs": ["sphinx>=4.0", "sphinx-rtd-theme"],
"viz": ["matplotlib>=3.0", "networkx>=2.0"],
}
```
Then install them with pip install -e ".[docs]" or pip
install -e ".[dev,docs]" for multiple groups.
### Testing
```bash
pytest
```
## Installation
```bash
pip install pyleetpatterns
```
## Quick Start
```python
from pyleetpatterns import PrefixSum, TwoPointers, SlidingWindow
# Example usage
ps = PrefixSum([1, 2, 3, 4, 5])
result = ps.range_sum(1, 3) # Sum from index 1 to 3
```
See full documentation in `leetcode-patterns-readme.md`
Raw data
{
"_id": null,
"home_page": null,
"name": "pyleetpatterns",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "leetcode, algorithms, patterns, interview, coding, data-structures",
"author": null,
"author_email": "q0d <ceo@q0d.net>",
"download_url": "https://files.pythonhosted.org/packages/c0/6d/3d9e4ddb4d4c86fc82b6abf377654ed6c928241142ed408f624f0aa177c9/pyleetpatterns-0.1.4.tar.gz",
"platform": null,
"description": "# PyLeetPatterns\n\nMaster 14 essential algorithmic patterns with drop-in Python implementations for LeetCode and coding interviews.\n\n### Production\n\n```bash\npip install . # This installs the package normally into your Python environment.\n```\n\n## Development\n\n### Setup\n\n```bash\ngit clone https://github.com/yourusername/pyleetpatterns.git\ncd pyleetpatterns\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -e . # This installs the package in \"editable\" mode, so changes tothe code are immediately reflected without reinstalling.\n\n# or\n\npip install -e \".[dev]\" # This installs the package in editable mode along with development tools (pytest, black, flake8, mypy).\n```\n\nThe [dev] packages are already defined in the setup.py\nfile. Look at lines 30-37:\n\n```py\nextras_require={\n \"dev\": [\n \"pytest>=7.0\",\n \"black>=22.0\",\n \"flake8>=4.0\",\n \"mypy>=0.900\",\n ]\n},\n```\n\nThis extras_require section in setup.py defines optional\ndependencies. When you run:\n\n```bash\npip install -e \".[dev]\"\n```\n\nIt will install:\n\n1. The package itself in editable mode (-e .)\n2. PLUS all the packages listed under the \"dev\" key:\n\n- pytest (for testing)\n- black (for code formatting)\n- flake8 (for linting)\n- mypy (for type checking)\n\nYou can add more development dependencies to this list if\nneeded. For example:\n\n```py\nextras_require={\n \"dev\": [\n \"pytest>=7.0\",\n \"black>=22.0\",\n \"flake8>=4.0\",\n \"mypy>=0.900\",\n \"ipython>=8.0\", # for interactive debugging\n \"pre-commit>=2.0\", # for git hooks\n ]\n},\n```\n\nYou could also define other optional dependency groups like:\n\n```py\nextras_require={\n \"dev\": [...],\n \"docs\": [\"sphinx>=4.0\", \"sphinx-rtd-theme\"],\n \"viz\": [\"matplotlib>=3.0\", \"networkx>=2.0\"],\n}\n```\n\nThen install them with pip install -e \".[docs]\" or pip\ninstall -e \".[dev,docs]\" for multiple groups.\n\n### Testing\n\n```bash\npytest\n```\n\n## Installation\n\n```bash\npip install pyleetpatterns\n```\n\n## Quick Start\n\n```python\nfrom pyleetpatterns import PrefixSum, TwoPointers, SlidingWindow\n\n# Example usage\nps = PrefixSum([1, 2, 3, 4, 5])\nresult = ps.range_sum(1, 3) # Sum from index 1 to 3\n```\n\nSee full documentation in `leetcode-patterns-readme.md`\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Master 14 essential algorithmic patterns with drop-in Python implementations for LeetCode and coding interviews",
"version": "0.1.4",
"project_urls": {
"Bug Reports": "https://github.com/yourusername/pyleetpatterns/issues",
"Homepage": "https://github.com/yourusername/pyleetpatterns",
"Source": "https://github.com/yourusername/pyleetpatterns"
},
"split_keywords": [
"leetcode",
" algorithms",
" patterns",
" interview",
" coding",
" data-structures"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "400bf0a2c444948d15ab6dbf4e358020f6269ecca37f114d4d28bbc894e5c640",
"md5": "aa5abae778d886a90c4ccf53af9415a7",
"sha256": "1616a893a96b37990e2c7059adf9a8b4bca82f1636c36e1f88056c7d7a0849a7"
},
"downloads": -1,
"filename": "pyleetpatterns-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "aa5abae778d886a90c4ccf53af9415a7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 19081,
"upload_time": "2025-08-26T05:06:04",
"upload_time_iso_8601": "2025-08-26T05:06:04.698924Z",
"url": "https://files.pythonhosted.org/packages/40/0b/f0a2c444948d15ab6dbf4e358020f6269ecca37f114d4d28bbc894e5c640/pyleetpatterns-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c06d3d9e4ddb4d4c86fc82b6abf377654ed6c928241142ed408f624f0aa177c9",
"md5": "2fb803cbd421b98cbc6e69df641befe4",
"sha256": "741be76fff433d701eff00eae94f3ab888775b3990aeb0a9cb3629eac8b6a4d9"
},
"downloads": -1,
"filename": "pyleetpatterns-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "2fb803cbd421b98cbc6e69df641befe4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 20624,
"upload_time": "2025-08-26T05:06:06",
"upload_time_iso_8601": "2025-08-26T05:06:06.016165Z",
"url": "https://files.pythonhosted.org/packages/c0/6d/3d9e4ddb4d4c86fc82b6abf377654ed6c928241142ed408f624f0aa177c9/pyleetpatterns-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-26 05:06:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yourusername",
"github_project": "pyleetpatterns",
"github_not_found": true,
"lcname": "pyleetpatterns"
}