Skip to main content

Expert Systems for Python

Project description

PyKnow: Expert Systems for Python Documentation Status

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."""

class RobotCrossStreet(KnowledgeEngine):
    def green_light(self):

    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'])))
Be cautious because light is blinking-yellow

You can find some more examples on GitHub.


Project details

Release history Release notifications

This version
History Node


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
experta-1.7.0.tar.gz (23.3 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