--- id: cel-python version: "0.5.0" license: unclear license_treatment: unclear maintenance: aging --- # cel-python — Pure Python implementation of Google Common Expression Language License: unclear · Maintenance: aging · Downloads: 6.7M/mo ## What it is and what it does cel-python is a pure Python runtime for Google's Common Expression Language, a domain-specific language designed for secure, portable expression evaluation across systems without exposing the full power of Python. It compiles CEL source code into an abstract syntax tree, then into an executable program that can be evaluated against provided context data. The package is intended for use cases where you need to safely evaluate user-supplied or policy-defined expressions—such as security filters, access control rules, or data validation—without the risks of arbitrary code execution. The implementation follows the Go CEL reference closely, with six core dependencies (google-re2, jmespath, lark, pendulum, pyyaml, tomli) that handle regex matching, JSON path queries, parsing, date/time operations, and configuration. It can be used as a library within Python applications or invoked from the command line as a calculator-like tool or JSON filter. Type semantics differ from Python's native types; division truncates toward zero rather than toward negative infinity, and type coercion is minimal. Use it for: - Embed security policy filters in infrastructure-as-code systems to evaluate compliance rules without executing arbitrary Python code. - Evaluate access control expressions in API gateways or authorization systems where policies must be portable across languages. - Validate or transform JSON data from stdin using CEL expressions, similar to jq but with CEL's type system and semantics. - Define and check complex business rules (e.g., account overdraft protection logic) in a sandboxed, language-neutral format. - Build policy-as-code systems where non-developers can write safe, auditable expressions for infrastructure or application decisions. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses and evaluates Google Common Expression Language (CEL) expressions in Python, enabling secure policy evaluation and cross-platform expression interoperability without requiring full Python execution. Yes, if you need to evaluate untrusted or policy-defined expressions safely without exposing Python's full execution model. The low install friction and lack of known vulnerabilities are positives. However, the aging maintenance status (195 days since last release) and unclear license require verification before production use. Suitable for embedded policy evaluation; less suitable if you need active upstream support. ## Install pip install cel-python uv add cel-python poetry add cel-python ## Installing cel-python Before you install: Low install friction with six runtime dependencies bundled as a wheel. Maintenance status is aging—last release was 195 days ago—but the package remains in Beta and supports current Python versions (requires Python 3.10+). License in practice: License treatment is unclear; no SPDX identifier or raw license text is available in the package metadata. Verify the actual license terms before use in proprietary or copyleft-sensitive projects. Quickstart: import cel-python env = Environment() ast = env.compile('account.balance >= 500') prgm = env.program(ast) result = prgm.evaluate({'account': json_to_cel({'balance': 600})}) Requires Python 3.10 or later. Verify before relying: - Whether the package is actively maintained or in maintenance-only mode given the 195-day gap since last release. - The actual license under which cel-python is distributed, since metadata shows no SPDX or raw license text. - Performance characteristics and scalability limits for large or complex CEL expressions in production use. - How type coercion and division semantics (truncating toward zero) affect real-world policy evaluation workflows. ## Package facts - License: not declared (unclear) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 6.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags CEL expression evaluator, common expression language python, policy expression evaluation, secure expression sandbox, cross-platform expression language, CEL parser and runtime, expression policy engine, expression-language, policy-engine, sandboxed-evaluation [View on SkillFed](https://skillfed.io/packages/cel-python) · [View on PyPI](https://pypi.org/project/cel-python/)