skillfed

json_logic_qubit

Build complex rules, serialize them as JSON, and execute them in Python

json-logic-qubit v0.9.1 454.5K downloads/30d#6,568 on PyPI
Permissive license MIT Abandoned released

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-qubit

uv

uv add json-logic-qubit

poetry

poetry add json-logic-qubit

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Topic :: Software Development :: Libraries :: Python Modules

Tags

json logic rules engineexecute json logic in pythoncross-language rule evaluationserialize conditional logic as jsonjsonlogic parserrules engine pythonlogic rules database storage
rules-enginejson-dslcross-language

More Python Modules packages