Skip to main content

CLIPS Python bindings

Project description

Python CFFI bindings for CLIPS 6.30

Source:

https://github.com/noxdafox/clipspy

Documentation:

https://clipspy.readthedocs.io

Download:

https://pypi.python.org/pypi/clipspy

Build Status Documentation Status

Installation

The CLIPS shared library and headers must be installed within the system.

If library and headers are not in the system default locations, they can be specified to the installer via the CFLAGS and LDFLAGS environment variables.

# CFLAGS="-I<headers path>" LDFLAGS="-L<library path>" pip install clipspy

Example

from clips import Environment, Symbol

environment = Environment()

# load constructs into the environment
environment.load('constructs.clp')

# assert a fact as string
environment.assert_string('(a-fact)')

# retrieve a fact template
template = environment.find_template('a-fact')

# create a new fact from the template
fact = template.new_fact()

# implied (ordered) facts are accessed as lists
fact.append(42)
fact.extend(("foo", "bar"))

# assert the fact within the environment
fact.assertit()

# retrieve another fact template
template = environment.find_template('another-fact')
fact = template.new_fact()

# template (unordered) facts are accessed as dictionaries
fact["slot-name"] = Symbol("foo")

fact.assertit()

# execute the activations in the agenda
environment.run()

Project details


Download files

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

Source Distribution

clipspy-0.2.0.tar.gz (21.0 kB view hashes)

Uploaded Source

Built Distributions

clipspy-0.2.0-cp36-cp36m-win_amd64.whl (478.1 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

clipspy-0.2.0-cp36-cp36m-win32.whl (415.9 kB view hashes)

Uploaded CPython 3.6m Windows x86

clipspy-0.2.0-cp35-cp35m-win_amd64.whl (478.1 kB view hashes)

Uploaded CPython 3.5m Windows x86-64

clipspy-0.2.0-cp35-cp35m-win32.whl (416.0 kB view hashes)

Uploaded CPython 3.5m Windows x86

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page