{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/3"}],"enrichment":{"capability":"Evaluates mathematical and logical expressions from strings in a safe, sandboxed way without using Python's built-in eval(), letting you add user-configurable formulas to applications.","skillfed_tags":["expression-evaluation","sandboxing","formula-parser"],"use_cases":["Allow users to define alarm volume rules that depend on time of day, alarm level, and other state without risking code injection.","Accept simple mathematical formulas in web forms or configuration files and evaluate them safely server-side.","Build rule engines or conditional logic systems where non-technical users can write expressions like 'if x > 10 then y else z'.","Implement dynamic pricing or discount calculations in e-commerce systems based on user-provided or admin-configured formulas.","Parse and evaluate mathematical expressions in scientific or educational applications without the security overhead of full eval()."],"what_it_does":"simpleeval is a lightweight library that safely evaluates mathematical and logical expressions provided as strings, without exposing the full power and security risks of Python's eval(). It uses Python's ast module to parse expressions and enforce strict limits on what operations are allowed, making it suitable for scenarios where you want to let users or configuration systems define formulas\u2014such as setting alarm volumes based on time of day, or allowing simple math in web forms\u2014without granting arbitrary code execution.\n\nThe library comes with sensible defaults: basic arithmetic, comparison, and bitwise operators; a handful of utility functions like randint(), int(), float(), and str(); and configurable limits on exponentiation and string length to prevent denial-of-service attacks. You can extend it by passing custom functions and variables (called 'names') into the evaluator, or by replacing operators entirely. It's deliberately kept simple and single-file, so you can even embed it directly in a project if you prefer not to add a dependency.","worth_installing":"Yes. The package is mature, has no dependencies, carries no known vulnerabilities, and solves a real security problem\u2014allowing safe user-defined expressions. Install it if you need to evaluate untrusted formulas; avoid it only if you need features beyond basic arithmetic, comparisons, and simple function calls, or if you're not concerned about the security implications of eval()."},"id":"simpleeval","links":{"html":"https://skillfed.io/packages/simpleeval","md":"https://skillfed.io/packages/simpleeval.md","pypi":"https://pypi.org/project/simpleeval/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-03-16","license_spdx":null,"license_treatment":"permissive","name":"simpleeval","python_support":"supports_current","summary":"A simple, safe single expression evaluator library."},"popularity":{"monthly_downloads":15002011,"position":1206,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"1.0.7"}
