Metadata-Version: 2.4
Name: pyleetpatterns
Version: 0.1.4
Summary: Master 14 essential algorithmic patterns with drop-in Python implementations for LeetCode and coding interviews
Author-email: q0d <ceo@q0d.net>
License: MIT
Project-URL: Homepage, https://github.com/yourusername/pyleetpatterns
Project-URL: Bug Reports, https://github.com/yourusername/pyleetpatterns/issues
Project-URL: Source, https://github.com/yourusername/pyleetpatterns
Keywords: leetcode,algorithms,patterns,interview,coding,data-structures
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: black>=22.0; extra == "dev"
Requires-Dist: flake8>=4.0; extra == "dev"
Requires-Dist: mypy>=0.900; extra == "dev"
Dynamic: license-file

# 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`
