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.1.0.tar.gz (57.8 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.1.0-py3-none-any.whl (53.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for clipspyx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9b7ae2e37f7ff5c52335f6d64d167bdcd32d4f32ac1654ab90ef4679210d6852
MD5 8c67cf3bb05d08de18983c34c5785ecb
BLAKE2b-256 7ae355ad1bb8a2f3958127e7605e6c9f5751313b4972e91c1a9a277f4f9ce4bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for clipspyx-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: clipspyx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 53.4 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 20cb02ed3d059f53be05e7d8e35db5a97d17eb5555751370ea04b5f2446f52ce
MD5 70d6f40fb68ee9a27c55660960e4335d
BLAKE2b-256 6d2da354947a5929ddcf493cbe3607faa94281e23e7d71dc9bb445ff6dcd41ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for clipspyx-0.1.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