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.2.0.tar.gz (64.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.2.0-py3-none-any.whl (56.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: clipspyx-0.2.0.tar.gz
  • Upload date:
  • Size: 64.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.2.0.tar.gz
Algorithm Hash digest
SHA256 1b93d44d2cb07ab8f3e81cfd0ef2f7223518e9057c42ef7234cd798203989ec6
MD5 d7bdf8141ac0f3b3ee4a39e3c7636c52
BLAKE2b-256 618c82f33a61cb5a0a39d08b0ede411a438766993ff03998d4c79e148fcbf123

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: clipspyx-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 56.6 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04d1ee09b133a2d2f9af9ce9ffe763abcab8e0152429795f2026dd64518731fb
MD5 a3ba02ddcd24381c06bdb10eb58f3b57
BLAKE2b-256 4af1c6ac8dd45b81ec2068e2a68a30b32d4dae1fc5b8b6f5e795b9da27239820

See more details on using hashes here.

Provenance

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