Show HN: A Python CEL implementation (written in Rust)

2 hardbyte 3 8/8/2025, 10:31:46 PM
I've been working on a Python library for the Common Expression Language (CEL). It's a wrapper around the cel-rust crate which is under heavy development. The python wrapper uses PyO3 and Maturin to handle the Rust-Python interop.

CEL is a safe, fast, non-Turing complete expression language, great for things like configuration, validation rules, or policy engines where you need to evaluate user-defined logic without the security risks of eval(). You can install it via pip or uv: `uv tool install common-expression-language`

And run the REPL: cel -i

Or evaluate an expression directly: cel 'size(data.things) > 1' --context '{"data": {"things": [1,2,3]}}

Docs: https://python-common-expression-language.readthedocs.io/en/... Source: https://github.com/hardbyte/python-common-expression-languag...

Comments (3)

zahlman · 4h ago
Neat, I see that documentation of CEL itself is appropriately cited/included too.
hardbyte · 3h ago
Hopefully clear I'm not trying to take credit for the upstream work!
zahlman · 3h ago
I think it was clear, yes. Projects like this one seem right in my wheelhouse (if I'd heard of CEL before, anyway) and I definitely appreciate seeing other people do things like this.