Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

Simple Conjunctive Normal Filter for python3

Project description

CNF is short for Conjunctive Normal Form, which is a way of grouping logical statements; namely, but grouping or statements together separated by and statements:

(a or b or ...) and (x or y or...) and ...

For simplicity, let us refer to each statement as a "filter", as most likely one will be applying CNF to some data to find what passes the statements.

Currently, we implement a filter in python3 via the dict type:

{
  'logic':    a string which is either 'and' or 'or'
  'lambda':   a lambda function to be applied to something
  'name':     a name which can help with keeping things clear
}

Thus given a list of such filters, one can call:

cnf.apply(cnf.group(filters), *lambda_args)

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
cnf-0.0.4-py3-none-any.whl (5.0 kB) Copy SHA256 hash SHA256 Wheel py3
cnf-0.0.4.tar.gz (3.2 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page