Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.


predicates is unavailable in PyPM, because there aren't any builds for it in the package repositories. Click the linked icons to find out why.

 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
Linux (64-bit)

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

https://travis-ci.org/agoraplex/predicates.png?branch=master https://coveralls.io/repos/agoraplex/predicates/badge.png?branch=master

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 https://github.com/agoraplex/predicates.git 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 setup.py nosetests

Use Sphinx to generate the HTML docs:

# to build in build/sphinx/html/...:
$ python setup.py 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 setup.py develop and extras thread on the python-distutils-sig mailing list).

Subscribe to package updates

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.