json_logic_qubit
Build complex rules, serialize them as JSON, and execute them in Python
What it is and what it does
json-logic-qubit is a Python implementation of the JsonLogic format, a JSON-based syntax for expressing conditional logic that can be shared across languages. It accepts JsonLogic rule objects and evaluates them against optional data, supporting operators like comparison (==, <, >), logical operations (and, or), and data variable access via the 'var' operator. Rules are plain JSON structures, making them serializable and storable in databases alongside records.
The package has no runtime dependencies and installs cleanly. It is a direct port of the JavaScript json-logic-js library. However, it has been abandoned since August 2018 with no maintenance or updates since its initial release, so it should be considered stable but unsupported.
Use it for:
- Store conditional business rules in a database alongside records and evaluate them dynamically without code deployment.
- Share validation or filtering logic between a web front-end and Python back-end without duplicating rule definitions.
- Build a rules engine for workflow automation, eligibility checks, or dynamic feature flags using JSON configuration.
- Evaluate complex nested conditions from external rule definitions without parsing custom DSLs or writing Python conditionals.
- Serialize and version control business logic as JSON for audit trails and rule change tracking.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses and executes JsonLogic rules—a language-agnostic JSON format for expressing conditional logic—allowing you to share and store rules between front-end and back-end code.
Yes, if you need to execute JsonLogic rules and can accept an unmaintained package. The library is simple, has no dependencies, and the JsonLogic format itself is stable and well-documented. Install it for rule evaluation in production only if you are comfortable maintaining a fork or have low risk tolerance for unpatched issues. Not recommended for new projects requiring active maintenance or support.
Install
json-logic-qubit on PyPI
pip
pip install json-logic-qubituv
uv add json-logic-qubitpoetry
poetry add json-logic-qubitInstalling json_logic_qubit
Before you install
Installation is straightforward with no runtime dependencies. However, the package is abandoned—last released in August 2018 with no maintenance activity since. Use only if the JsonLogic format itself is stable enough for your use case and you can maintain a fork if needed.
License in practice
MIT license permits commercial and private use with minimal restrictions, requiring only attribution and inclusion of the license text.
Quickstart
pip install json-logic-qubit
from json_logic import jsonLogic
# Simple comparison
result = jsonLogic({"==": [1, 1]})
# True
# Data-driven rule
rules = {"<": [{"var": "temp"}, 110]}
data = {"temp": 100}
result = jsonLogic(rules, data)
# True
Verify before relying
- Whether the package works reliably with modern Python versions beyond 3.7, given its abandoned status and age.
- Real-world performance characteristics when executing complex nested rules or large rule sets.
- Whether the implementation fully matches the current JsonLogic specification at jsonlogic.com.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,921 days since the last release |
| First released | |
| Downloads | 454,522/month — #6,568 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: json_logic_qubit-0.9.1-py2.py3-none-any.whl
Keywords: json-logic
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
json-logicParses and executes JsonLogic rules—a…
permissive · top 5,000 on PyPI
panzi-json-logicEvaluates JsonLogic and CertLogic…
permissive · top 15,000 on PyPI
business-rulesA Python DSL for defining business rules as…
permissive · top 15,000 on PyPI
zen-enginezen-engine is a Python binding for a Rust-based…
unclear · top 15,000 on PyPI
jsonableProvides an abstract base class for defining…
permissive · top 15,000 on PyPI
jsonpath-pythonExtracts, filters, sorts, and updates values in…
permissive · top 1,000 on PyPI
anyjsonAnyjson provides a uniform API for JSON…
permissive · top 15,000 on PyPI
databricks-labs-dqxDQX provides rule-based data quality checking…
unclear · top 5,000 on PyPI
json-flattenConverts nested JSON objects into flat…
permissive · top 15,000 on PyPI
plyaraParses YARA rule files into Python dictionary…
permissive · top 15,000 on PyPI