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 pyclips

Example

from clips import Environment, Symbol

environment = Environment()

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

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

# retrieve a fact template
template = environment.facts.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.facts.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.agenda.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.1.2.tar.gz (20.9 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for clipspy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8a2fb1934c47d526dcc127be6aa88f2c0d4113142744f97827c10abd9312388e
MD5 3290b95a8710d979581935bb529b2aa8
BLAKE2b-256 03cb1522ef6ac715c35cef48cb12121417f08f44244f7cffb1e08c0c5c5a20bf

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