{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/2"}],"enrichment":{"capability":"Asteval is a safe Python expression and statement evaluator that uses the ast module to interpret user input without the risks of Python's built-in eval().","skillfed_tags":["sandboxed-execution","expression-evaluation","embedded-scripting"],"use_cases":["Embed a formula or macro language in a GUI or web application to let users define calculations without exposing eval() risks.","Build a simple calculator or expression evaluator for mathematical or scientific workflows.","Parse and execute user-supplied configuration or rule definitions in a controlled sandbox.","Evaluate conditional expressions or transformations in data processing pipelines.","Prototype or test Python logic without running untrusted code in the main interpreter."],"what_it_does":"Asteval is a restricted Python interpreter that safely evaluates expressions and statements by parsing them into Python's abstract syntax tree (AST) and walking the tree to compute results. It supports a large subset of Python\u2014conditionals, loops, comprehensions, f-strings, standard data structures, and math/NumPy functions when available\u2014while intentionally blocking unsafe operations like class creation, module imports, eval/exec, and access to private methods. This makes it suitable for embedding in applications that need to accept user-written formulas or scripts without the security risks of Python's eval().\n\nThe package has no external runtime dependencies and works with Python 3.10 and later, including PyPy. It emphasizes mathematical expressions, so NumPy functions are automatically available if NumPy is installed. Programmers can inject custom functions and data into each Asteval session, and users can define their own functions within the language's constraints. The AST-based approach guarantees parsing identical to Python's, making correctness straightforward to verify.","worth_installing":"Yes. Asteval is a mature, actively maintained package (latest release 2026-06-11, no known vulnerabilities) with zero runtime dependencies and low install friction. It solves a real security problem\u2014safe evaluation of user input\u2014and is well-suited for embedded scripting, mathematical evaluation, or any scenario where you need Python-like syntax without the risks of eval(). The MIT license is permissive. Install it if you need to accept and execute user-written expressions safely."},"id":"asteval","links":{"html":"https://skillfed.io/packages/asteval","md":"https://skillfed.io/packages/asteval.md","pypi":"https://pypi.org/project/asteval/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-06-11","license_spdx":"MIT","license_treatment":"permissive","name":"asteval","python_support":"supports_current","summary":"Safe, minimalistic evaluator of python expression using ast module"},"popularity":{"monthly_downloads":6261626,"position":1945,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"1.0.9"}
