Metadata-Version: 2.1
Name: proq
Version: 0.0.2
Summary: Process Queue
Author-email: Roi Gabay <roigby@gmail.com>
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Dist: black ; extra == "dev"
Requires-Dist: mypy ; extra == "dev"
Requires-Dist: pytest ; extra == "test"
Requires-Dist: pytest-cov ; extra == "test"
Project-URL: Bug Tracker, https://github.com/gabay/proq/issues
Project-URL: Home, https://github.com/gabay/proq
Provides-Extra: dev
Provides-Extra: test

# Process Queue

Simplify data processing using pipelines.

- Inline - create the numbers 1-10, square them, then sum the results:

```python
result = proq.create(range(11)).map(lambda x: x ** 2).reduce(lambda x, y: x + y).next()
```

- Procedurally

```python
# Create a square numbers proq and split into two
data1, data2 = proq.create(range(11)).map(lambda x: x ** 2).tee()

# negate one of the streams
data1_neg = data1.map(lambda x: -x)

# add 1 to the other
data2_plus_1 = data2.map(lambda x: x + 1)

# Iterate over the results
for d1, d2 in zip(data1_neg, data2_plus_1):
    print(d1, d2, d1 + d2)
    assert d1 + d2 == 1
```

# Installation

```bash
pip install proq
```

# Development

- Download source
- Install development dependencies: `flit install -s --deps develop`
- Format code: `black .`
- Run tests: `pytest`
- Bump version in `src/proq/__init__.py`
- Build package: `flit build`
- Deploy: `flit publish`

