Official Python bindings for logicpearl-engine.
Project description
logicpearl
Official Python bindings for logicpearl-engine.
Use this package when:
- Python code needs to execute a pearl artifact or pipeline directly
- you want a real bridge to the Rust execution surface
- you do not want to shell out to the CLI for every request
Do not use it as a reason to bake observers into pearls. The intended split is still:
- observer/plugin: messy input interpretation
- pearl: deterministic policy artifact
- verify/response: operational interpretation
Example
from logicpearl import LogicPearlEngine
engine = LogicPearlEngine.from_artifact_path("/path/to/logicpearl-bundle")
result = engine.evaluate({
"age": 34,
"member": True,
"country": "US",
})
print(result["decision_kind"])
print(result["allow"])
For pipeline execution, use LogicPearlEngine.from_pipeline_path("/path/to/pipeline.json").
The installed Python package does not bundle the repository examples under examples/.
Scope
This package exposes local execution through logicpearl-engine.
It is:
- a local evaluation library, not a service client
- not a reimplementation of runtime semantics in Python
- not a wrapper around
logicpearlCLI subprocess calls
API Shape
LogicPearlEngine.from_path(path) loads an artifact or pipeline once. Reuse the
engine object for request-time evaluation.
evaluate(input)returns the runtime result payload directly. For gate and action artifacts, this matcheslogicpearl run --json.evaluate_batch(inputs)returns a list of runtime result payloads.run(input)returns the full engine envelope with the artifact kind included.run_single(input)andrun_batch(inputs)expose the same envelope shape for callers that need dispatch metadata.
Inputs must be JSON-compatible Python values: dict, list, tuple, str, int, float, bool, or None. Evaluation runs in Rust without spawning the CLI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file logicpearl-0.1.5.tar.gz.
File metadata
- Download URL: logicpearl-0.1.5.tar.gz
- Upload date:
- Size: 66.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d54fe0baa36191769d3eee4d3cc449dfcdac379c9c01d4cd8130b959e396b6a3
|
|
| MD5 |
ba356ba201883224996a92ad30109692
|
|
| BLAKE2b-256 |
41010fa1943661c959ea4e7a19b94aff22e499dc65095c7dfbaa5a493d435452
|
File details
Details for the file logicpearl-0.1.5-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: logicpearl-0.1.5-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a1889ce132260e4846ab837bb970285cec9de308dcf2a47753c906b17df2556
|
|
| MD5 |
06877c483fe6f941c643b9903b07c11c
|
|
| BLAKE2b-256 |
b50632955758c3665bcb752e40c1e4cfe7907fb4877b187dbfbc1d271148cca9
|