Registry / devops / jsonlogic-rs

jsonlogic-rs

JSON →
library0.5.0pypypi✓ verified 80d ago

JsonLogic implemented with a Rust backend. Provides fast evaluation of JsonLogic rules in Python. Current version 0.5.0, active development.

pip install jsonlogic-rs
INSTALL
IMPORT
SIG · JSONLOGIC-RS
J
jsonlogic-rs
devopspythonv0.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

apply
from jsonlogic_rs import apply
import jsonlogic
apply_serialized
from jsonlogic_rs import apply_serialized
import jsonlogic
jsonlogic
from jsonlogic_rs import jsonlogic
import jsonlogic

Apply a simple JsonLogic rule to data.

import jsonlogic rule = {"==": [1, 1]} data = {} result = jsonlogic.apply(rule, data) print(result) # True # With environment variable for optional config import os api_key = os.environ.get('MY_API_KEY', '') if api_key: print(f"Using API key: {api_key}")
Debug
Known issues
gotchaThe package name is 'jsonlogic', not 'jsonlogic-rs' or 'jsonlogic_rs'. Import using 'import jsonlogic'.
fix
Use 'import jsonlogic' and 'pip install jsonlogic-rs'.
affects: all
gotchaThe 'apply' function returns native Python types, not JsonLogic objects.
fix
Expect bool, int, float, str, list, dict, or None.
affects: >=0.1.0
deprecatedEarly versions (pre-0.5) may have used a different API; check documentation if upgrading from <=0.4.
fix
Update to >=0.5.0 and use 'jsonlogic.apply(rule, data)'.
affects: <0.5.0
Upgrade
Version history
0.5.0latest on PyPI · released Dec 13, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
jsonlogic-rs — pip install jsonlogic-rs · libregistry