Skip to main content

CLIPS Python bindings via CFFI

Project description

clipspyx

CLIPS Python bindings via CFFI. Fork of clipspy.

Building

clipspyx compiles CLIPS source directly into the CFFI extension. No separate libclips build step.

Prerequisites

  • Python 3.10+
  • C compiler (gcc/clang on Linux/macOS, MSVC on Windows)
  • CLIPS source (auto-checked out from orphan branch, or provide your own)

Install for development

# Install with 64x backend (CLIPS 6.4x)
uv sync --extra 64x

# Install with 70x backend (CLIPS 7.0x)
uv sync --extra 70x

Switching backends

The 64x and 70x backends conflict with each other. Always use uv sync to switch:

# Switch to 64x
uv sync --extra 64x

# Switch to 70x
uv sync --extra 70x

Important: uv run --extra 64x does not remove a previously installed 70x backend (and vice versa). Only uv sync --extra <variant> correctly installs the requested backend and removes the conflicting one.

CLIPS source override

# Use an arbitrary CLIPS source directory
CLIPS_SOURCE_DIR=/path/to/clips/core uv sync --extra 64x

Build distributable wheels

uv run scripts/build-backend.py 64x   # builds clipspyx-ffi + clipspyx-ffi-64x wheels
uv run scripts/build-backend.py 70x   # builds clipspyx-ffi + clipspyx-ffi-70x wheels

CLIPS Source Management

CLIPS source is stored in git orphan branches (clips-64x, clips-70x). Sync from SVN:

uv run scripts/sync-svn.py 64x   # syncs core/ -> orphan branch clips-64x
uv run scripts/sync-svn.py 70x   # syncs core/ -> orphan branch clips-70x

Usage

import clipspyx

env = clipspyx.Environment()
env.build('(defrule hello (initial-fact) => (println "Hello CLIPS!"))')
env.reset()
env.run()

Testing

uv run pytest tests/ -v

License

BSD-3-Clause. See LICENSE.txt.

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

clipspyx-0.3.0.tar.gz (71.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clipspyx-0.3.0-py3-none-any.whl (60.5 kB view details)

Uploaded Python 3

File details

Details for the file clipspyx-0.3.0.tar.gz.

File metadata

  • Download URL: clipspyx-0.3.0.tar.gz
  • Upload date:
  • Size: 71.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for clipspyx-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3a43b06867fd902246a83c6f1a28a1e041b6350fb96f69461ed8e9c0b609e69c
MD5 3e2006f2ce69b0edd66c515d6c0c0852
BLAKE2b-256 adbd6e624159f8d18db9ee0235b3e67b114c5871900156c6a1372bbf6332fe1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for clipspyx-0.3.0.tar.gz:

Publisher: wheels.yml on inferal-oss/clipspyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clipspyx-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: clipspyx-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 60.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for clipspyx-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d3b19fdfe710fd7d53ab7ccd0b352e772d4f488bb6c2f60359d48b86ad2698d
MD5 5666513a595bf00a296dc15f8c9e71f6
BLAKE2b-256 7fbbf715d2cd0af748485398edc9cf5c2c09c45e203a03dd2331d1f535841f7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for clipspyx-0.3.0-py3-none-any.whl:

Publisher: wheels.yml on inferal-oss/clipspyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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