Skip to main content

A collection of predicate factories, functions, and partials, for functional programming.

Project description

A collection of predicate factories, functions, and partials, for functional programming.

The predicates module provides a variety of predicates, predicate factories, and predicate partials.

“A predicate is a function that returns the truth value of some condition.”

—Andrew M. Kuchling, Python Functional Programming HOWTO

Predicate factories are functions which create new predicates based on their arguments (e.g., _and, _nargs). Predicate partials are functions created by partial application of a predicate’s arguments.

Complete project documentation is available. Project source is available at the github project page.


To install from PyPI:

$ pip install predicates

Developer installation

To install the development version from the github repository:

$ git clone predicates
$ cd predicates
$ virtualenv-2.7 --no-site-packages venv
$ pip install -e '.[docs,tests]'


Pay particular attention to that pip install line. That’s a period, followed by [docs,tests] [1] (and it’s in single-quotes to keep bash from misunderstanding the square brackets).

Use nosetests to run the test suite:

$ python nosetests

Use Sphinx to generate the HTML docs:

# to build in build/sphinx/html/...:
$ python build_sphinx

# to build in docs/_build/html/... (which is what I do):
$ make -C docs
[1]Yes, it’s a hack. See the python develop and extras thread on the python-distutils-sig mailing list).

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for predicates, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size predicates-0.0.5-py2.7.egg (16.5 kB) File type Egg Python version 2.7 Upload date Hashes View
Filename, size predicates-0.0.5.tar.gz (9.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page