Skip to content

Pundit is a ITTT (If This Then That) for python, where decision is made according to the conditions specified and gives you what you expect.

License

Notifications You must be signed in to change notification settings

sachin-philip/pundit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pundit - ITTT for python

Pundit is a ITTT (If This Then That) for python, where decision is made according to the conditions specified and gives you what you expect. Pundit supports string type, integer

Documentation

Installation

pip install pundit

Basic Usages

Set Structure for Input

from pundit.base import PunditBase
base = PunditBase()

#### Usage

base.add_structure(arg_1, arg_2)

Set conditiongroup

from pundit.condition import Conditiongroup
conditiongroup = Conditiongroup()

#### Usage

conditiongroup.add_condition(match, condition type, argument, success response, failed response)

Match: str or integer data argument Argument: arguments arg_1, arg_2 which was set as structure

Condition Types:

String
IN
NOT_IN
NOT_IS

Integer
EQ
NOT_EQ
GT
LT
GTE
LTE

Evaluate pundit

from pundit import Pundit
pundit = Pundit(base, conditiongroup)


>>> pundit.evaluate(input_1, input_2)

input Input to evaluate

About

Pundit is a ITTT (If This Then That) for python, where decision is made according to the conditions specified and gives you what you expect.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages