--- id: json-logic-qubit version: "0.9.1" license: MIT license_treatment: permissive maintenance: abandoned --- # json_logic_qubit — Build complex rules, serialize them as JSON, and execute them in Python License: permissive · Maintenance: abandoned · Downloads: 454.5K/mo ## 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 above — 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 pip install json-logic-qubit uv add json-logic-qubit 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: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 454.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags json logic rules engine, execute json logic in python, cross-language rule evaluation, serialize conditional logic as json, jsonlogic parser, rules engine python, logic rules database storage, rules-engine, json-dsl, cross-language [View on SkillFed](https://skillfed.io/packages/json-logic-qubit) · [View on PyPI](https://pypi.org/project/json-logic-qubit/)