py-expression-eval
Python Mathematical Expression Evaluator
Decision gist · record as of 2026-08-14
Yes, if you need a lightweight, dependency-free expression evaluator for a stable use case. The package is mature and has no known vulnerabilities. However, do not use it for new projects requiring active maintenance or support—the repository is archived and the last commit was 2022-06-11. For actively maintained alternatives or complex symbolic math, consider other options.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Installation is straightforward with no runtime dependencies.
- However, the repository is archived and the last commit was 2022-06-11, indicating the project is no longer actively maintained.
License · maintenance · safety
MIT (permissive) — Licensed under MIT (permissive), allowing free use, modification, and distribution with minimal restrictions.
last release 2021-08-26 (1814 days) · last repo commit 2022-06-11 · 150 stars · archived
0 known vulnerabilities (OSV.dev, 2026-08-14) · 150,894 downloads/mo, #10,951 on PyPI
Alternatives
Verify before relying
pip install py-expression-eval
from py_expression_eval import Parser
parser = Parser()
result = parser.parse('2 * x + 1').evaluate({'x': 3})
print(result) # 7- Whether the package handles edge cases in expression parsing (division by zero, invalid syntax) gracefully
- Performance characteristics when evaluating complex nested expressions or with many variables
- Compatibility with Python versions beyond 3.9, given the latest release predates newer Python versions
What it is and what it does
py-expression-eval is a mathematical expression parser and evaluator ported from a JavaScript library. It takes mathematical expressions as strings and converts them into evaluable objects that can be computed with variable substitution. The library supports standard arithmetic operators, trigonometric and logarithmic functions, boolean logic, and constants like PI and E.
You create a Parser instance, call parse() on an expression string to get an Expression object, then evaluate() it with a dictionary of variable values. The library also offers simplification (reducing expressions algebraically), substitution (replacing variables with other expressions), and variable extraction. It's useful for applications that need to accept user-supplied or configuration-based mathematical formulas without executing arbitrary code.
Use it for
- Accept mathematical formulas from users in web forms or configuration files and compute results safely
- Build spreadsheet-like applications where cells contain formulas referencing other cells
- Implement rule engines or business logic systems that rely on user-defined mathematical conditions
- Validate and simplify mathematical expressions in educational or scientific tools
- Generate dynamic calculations in data processing pipelines where formulas are stored as strings
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need a lightweight, dependency-free expression evaluator for a stable use case.
The package is mature and has no known vulnerabilities. However, do not use it for new projects requiring active maintenance or support—the repository is archived and the last commit was 2022-06-11. For actively maintained alternatives or complex symbolic math, consider other options.
Install
py-expression-eval on PyPI
Before you install
Installation is straightforward with no runtime dependencies. However, the repository is archived and the last commit was 2022-06-11, indicating the project is no longer actively maintained.
License in practice
Licensed under MIT (permissive), allowing free use, modification, and distribution with minimal restrictions.
Quickstart
pip install py-expression-eval
from py_expression_eval import Parser
parser = Parser()
result = parser.parse('2 * x + 1').evaluate({'x': 3})
print(result) # 7
Verify before relying
- Whether the package handles edge cases in expression parsing (division by zero, invalid syntax) gracefully
- Performance characteristics when evaluating complex nested expressions or with many variables
- Compatibility with Python versions beyond 3.9, given the latest release predates newer Python versions
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Abandoned 1,814 days since the last release |
| Last repo commit | repository archived |
| First released | |
| Downloads | 150,894 / month, #10,951 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: py_expression_eval-0.3.14-py3-none-any.whl
Tags
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 › “parse mathematical expressions”
- py-expression-evalParses and evaluates mathematical expressions from strings,…
- latex2sympy2Parses LaTeX math expressions and converts them to SymPy symbolic…
- latex2sympy2-extendedParses LaTeX math expressions and converts them to SymPy symbolic…
Give your agent the search over MCP, or paste the wish link into any chat.
More Mathematics packages
NetworkX provides data structures and algorithms for creating, analyzing, and manipulating graphs and networks, supporting everything from simple undirected graphs to complex directed and weighted networks.
kiwisolver is a Python binding to a fast C++ implementation of the Cassowary constraint solver, enabling you to solve systems of linear constraints and inequalities.
Install it if you need to solve constraint systems; skip it if you only need simple linear algebra.
SymPy is a Python library for symbolic mathematics, performing algebraic manipulation, calculus, equation solving, and mathematical expression simplification without numerical approximation.
ContourPy calculates contours of 2D quadrilateral grids using C++11 algorithms wrapped in Python, offering serial and multithreaded implementations without requiring Matplotlib as a dependency.
PyTorch provides GPU-accelerated tensor computation and automatic differentiation for building and training deep neural networks in Python.
onnxruntime loads and executes Open Neural Network Exchange (ONNX) models with a focus on inference performance across CPUs and accelerators.
Install it if you have ONNX models to run in production or development.
See also asteval · jsonata-python · simpleeval · math-verify · leval · boolean.py · envsubst · pure-eval · tag-expressions · cel-expr-python