$npx skillfedfor your agent

leval

Limited evaluator

Worth itPyPI Software DevelopmentReleased Aug 2026181.9K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — leval-1.4.0-py3-none-any.whl
v1.4.0 · released 2026-08-13 · Python >=3.8

Yes. Leval is a focused, well-maintained tool with zero dependencies, active development, and no known vulnerabilities. It solves a real security problem—safe dynamic expression evaluation—better than ast.literal_eval() for cases where you need variables and functions. Install it if you need to evaluate user or config expressions safely; skip it if you only need literal Python values.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.8 or later.
  • Very low friction: pure Python wheel with no runtime dependencies, and actively maintained with a release on 2026-08-13.

License · maintenance · safety

MIT (permissive) — MIT license permits commercial and private use with minimal restrictions, requiring only attribution.

last release 2026-08-13 (1 days) · last repo commit 2026-08-13 · 3 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 181,868 downloads/mo, #10,112 on PyPI

Verify before relying

from leval.simple import simple_eval

assert simple_eval('1 + 2') == 3
assert simple_eval('x < -80 or x > 125 or x == 85', values={'x': 85})
assert simple_eval('abs(x) > 80', values={'x': -85}, functions={'abs': abs})
  • Real-world performance characteristics when evaluating deeply nested or complex expressions.
  • Whether max_time enforcement is sufficient for your threat model, given it is cooperative rather than preemptive.
Same gist for agents: .md · .json

What it is and what it does

Leval is a Python expression evaluator designed to be safer and more flexible than ast.literal_eval() while remaining sandboxed. It parses expressions into an AST and walks it in pure Python, never using getattr or subscripting outside your control. You define which functions and variables are available, and can enforce depth and time limits on evaluation.

The package offers two APIs: a simple_eval() function for straightforward cases (arithmetic, comparisons, function calls with your registered functions), and an advanced API with subclassable Evaluator and Universe classes for custom evaluation rules. Security depends entirely on what you register—any function you provide can be called with attacker-controlled arguments, and operators invoke dunder methods on your values, so avoid registering functions with side effects or objects with dangerous comparisons.

Use it for

  • Evaluate user-supplied mathematical or logical expressions in web forms or configuration files without executing arbitrary code.
  • Build a formula engine for applications where users define calculations with controlled variables and functions.
  • Implement conditional rule evaluation in data pipelines where expressions reference row values but cannot access the filesystem or network.
  • Parse and evaluate templated expressions in configuration systems with bounded complexity and execution time.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

Leval is a focused, well-maintained tool with zero dependencies, active development, and no known vulnerabilities. It solves a real security problem—safe dynamic expression evaluation—better than ast.literal_eval() for cases where you need variables and functions. Install it if you need to evaluate user or config expressions safely; skip it if you only need literal Python values.

Install

leval on PyPI

Before you install

Very low friction: pure Python wheel with no runtime dependencies, and actively maintained with a release on 2026-08-13.

Requires Python 3.8 or later.

License in practice

MIT license permits commercial and private use with minimal restrictions, requiring only attribution.

Quickstart

from leval.simple import simple_eval

assert simple_eval('1 + 2') == 3
assert simple_eval('x < -80 or x > 125 or x == 85', values={'x': 85})
assert simple_eval('abs(x) > 80', values={'x': -85}, functions={'abs': abs})

Verify before relying

  • Real-world performance characteristics when evaluating deeply nested or complex expressions.
  • Whether max_time enforcement is sufficient for your threat model, given it is cooperative rather than preemptive.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.8
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 1 days since the last release
Last repo commit
First released
Downloads181,868 / month, #10,112 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14

Evidence: leval-1.4.0-py3-none-any.whl

Tags

Capabilities
safe expression evaluationlimited ast evaluatordynamic expression parsersandboxed math evaluationcontrolled formula evaluation
Topics
expression-evaluationsandboxing

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “safe expression evaluation”

  • levalLeval evaluates limited expressions safely by parsing them into an…
  • common-expression-languageEvaluates Google's Common Expression Language (CEL) expressions in…
  • astevalAsteval is a safe Python expression and statement evaluator that uses…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also asteval · simpleeval · pure-eval · py-expression-eval · cel-python · common-expression-language · tag-expressions · autoevals · trampoline · bddl