Metadata-Version: 2.1
Name: compoz
Version: 0.1.0b3
Summary: A simple composition library
Home-page: https://github.com/haroldcohen/compoz
License: MIT
Keywords: composition,compose,functional programming
Author: Harold Cohen
Author-email: me@harold-cohen.com
Requires-Python: >=3.10,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Project-URL: Changelog, https://github.com/haroldcohen/compoz/blob/master/CHANGELOG.md
Project-URL: Issues, https://github.com/haroldcohen/compoz/issues
Project-URL: Repository, https://github.com/haroldcohen/compoz.git
Description-Content-Type: text/markdown

# Compoz

Compoz is a lightweight composition package.

## Overview

Compoz provides with two main functions:

- composite (for standard composition)
- pipe (for reversed composition)

### 'composite'

'composite' will run from last to the first function provided.

```python
from compoz import composite


def multiply_by_3(n: int) -> int:
    return n * 3


def subtract_5(n: int) -> int:
    return n - 5


composite_func_1 = composite(subtract_5, multiply_by_3)
print(composite_func_1(10))
# Output will be 25

composite_func_2 = composite(multiply_by_3, subtract_5)
print(composite_func_2(10))
# Output will be 15
```

### 'pipe'

'pipe' will run from first to the last function provided.

```python
from compoz import pipe


def multiply_by_3(n: int) -> int:
    return n * 3


def subtract_5(n: int) -> int:
    return n - 5


pipe_func_1 = pipe(subtract_5, multiply_by_3)
print(pipe_func_1(10))
# Output will be 15

pipe_func_2 = pipe(multiply_by_3, subtract_5)
print(pipe_func_2(10))
# Output will be 25
```
