buguroo/pyknow


PyKnow: Expert Systems for Python

License: LGPL-3.0

Language: Python

Keywords: expert-system, inference-engine, python3


PyKnow: Expert Systems for Python

https://travis-ci.org/buguroo/pyknow.svg?branch=master Documentation Status codecov.io

PyKnow is a Python library for building expert systems strongly inspired by CLIPS.

from random import choice
from pyknow import *


class Light(Fact):
    """Info about the traffic light."""
    pass


class RobotCrossStreet(KnowledgeEngine):
    @Rule(Light(color='green'))
    def green_light(self):
        print("Walk")

    @Rule(Light(color='red'))
    def red_light(self):
        print("Don't walk")

    @Rule(AS.light << Light(color=L('yellow') | L('blinking-yellow')))
    def cautious(self, light):
        print("Be cautious because light is", light["color"])
>>> engine = RobotCrossStreet()
>>> engine.reset()
>>> engine.declare(Light(color=choice(['green', 'yellow', 'blinking-yellow', 'red'])))
>>> engine.run()
Be cautious because light is blinking-yellow

You can find some more examples on GitHub.

Project Statistics

Sourcerank 6
Repository Size 1.68 MB
Stars 165
Forks 39
Watchers 27
Open issues 17
Dependencies 9
Contributors 3
Tags 28
Created
Last updated
Last pushed

Top Contributors See all

Roberto Abdelkader Martínez Pérez David Francos Juan Paredes

Packages Referencing this Repo

pyknow
PyKnow: Expert Systems for Python
Latest release 1.7.0 - Updated - 165 stars

Recent Tags See all

v1.7.0 May 10, 2018
v1.6.0 May 08, 2018
v1.5.0 April 05, 2018
v1.4.0 April 03, 2018
v1.3.0 March 28, 2018
v1.2.0 March 27, 2018
v1.1.1 April 26, 2017
v1.1.0 April 06, 2017
v1.0.1 April 06, 2017
v1.0.0 March 29, 2017
v0.1.8 February 27, 2017
v0.1.7 February 21, 2017
v0.1.6 February 20, 2017
v0.1.5 February 16, 2017
v0.1.4 February 15, 2017

Interesting Forks See all

nilp0inter/experta
Expert Systems for Python
Python - LGPL-3.0 - Last pushed - 14 stars - 1 forks

Something wrong with this page? Make a suggestion

Last synced: 2018-05-09 23:25:20 UTC

Login to resync this repository