Metadata-Version: 2.3
Name: py_predicate
Version: 0.1
Summary: Module to create composable predicates
Author-email: Maurits Rijk <maurits.rijk@gmail.com>
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development
Classifier: Typing :: Typed
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: graphviz
Requires-Dist: more-itertools
Requires-Dist: bumpversion ; extra == "dev"
Requires-Dist: jsonschema ; extra == "dev"
Requires-Dist: pre-commit ; extra == "dev"
Requires-Dist: black ; extra == "test"
Requires-Dist: mypy ; extra == "test"
Requires-Dist: mypy_extensions ; extra == "test"
Requires-Dist: pytest ; extra == "test"
Requires-Dist: pytest-cov ; extra == "test"
Requires-Dist: ruff ; extra == "test"
Project-URL: Source, https://github.com/mrijk/py-predicate
Provides-Extra: dev
Provides-Extra: test

![Documentation](https://github.com/mrijk/py-predicate/actions/workflows/pages.yaml/badge.svg)
![Test](https://github.com/mrijk/py-predicate/actions/workflows/test.yaml/badge.svg)
[![codecov](https://codecov.io/gh/mrijk/py-predicate/graph/badge.svg?token=KMBDJNC3W9)](https://codecov.io/gh/mrijk/py-predicate)

# Introduction

py-predicate is a Python library to create composable predicates

# Example

```python
    filtered = [x for x in range(10) if x >= 2 and x <= 3]
```

Version with predicates:

```python
    ge_2 = ge_p(2)
    le_3 = le_p(3)

    between_2_and_3 = ge_2 & le_3
    filtered = [x for x in range(10) if between_2_and_3(x)]
```

Of course this example looks way more complicated than the original version. The point here is that you can build
reusable predicates that can be used in multiple locations
