Metadata-Version: 2.1
Name: foreach
Version: 0.1.0
Summary: 
Author: Jaime Liew
Author-email: jaimeliew1@gmail.com
Requires-Python: >=3.7,<4.0
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
Requires-Dist: tqdm (>=4.66.1,<5.0.0)
Description-Content-Type: text/markdown



# `foreach`

`foreach` is a tiny Python package that provides a parallel for loop implementation using multiprocessing.

## Installation

You can install the package using pip:

```bash
pip install foreach
```

## Usage

```python
from foreach import foreach

def square(x):
    return x**2

params = [1, 2, 3, 4, 5]
result = foreach(square, params)
print(result)
# [1, 4, 9, 16, 25]
```

## `foreach` Parameters

```python
foreach(func: Callable, params: List, parallel: bool = True) -> List)
```
- `func` (callable): The function to apply to each element.
- `params` (list): The list of parameters to apply the function to.
- `parallel` (bool): If True, use multiprocessing for parallel execution. Default is True.




## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

