{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/14"}],"enrichment":{"capability":"Leval evaluates limited expressions safely by parsing them into an AST and walking it in Python, supporting depth and time limits alongside optional variable and function mappings.","skillfed_tags":["expression-evaluation","sandboxing"],"use_cases":["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."],"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.\n\nThe 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\u2014any 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.","worth_installing":"Yes. Leval is a focused, well-maintained tool with zero dependencies, active development, and no known vulnerabilities. It solves a real security problem\u2014safe dynamic expression evaluation\u2014better 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."},"id":"leval","links":{"html":"https://skillfed.io/packages/leval","md":"https://skillfed.io/packages/leval.md","pypi":"https://pypi.org/project/leval/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-08-13","license_spdx":"MIT","license_treatment":"permissive","name":"leval","python_support":"supports_current","summary":"Limited evaluator"},"popularity":{"monthly_downloads":181868,"position":10112,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.4.0"}
