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.1.tar.gz (21.1 kB view details)

Uploaded Source

File details

Details for the file clipspy-0.2.1.tar.gz.

File metadata

  • Download URL: clipspy-0.2.1.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for clipspy-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ccd2559a64e366ad56637af70253d30a959ee697e13d163637f18f1fbbeecf81
MD5 5762b56ebf441201bdee6060d727db7d
BLAKE2b-256 902e2bf3e3e17b07b0b8c49ec339db577395f514eb3331feb23bace11482917d

See more details on using hashes here.

Supported by

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