$npx skillfedfor your agent

py-expression-eval

Python Mathematical Expression Evaluator

With conditionsPyPI MathematicsReleased Aug 2021150.9K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — py_expression_eval-0.3.14-py3-none-any.whl
v0.3.14 · released 2021-08-26

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

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
Same gist for agents: .md · .json

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.

With conditions

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

LicenseMIT permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceAbandoned 1,814 days since the last release
Last repo commit repository archived
First released
Downloads150,894 / month, #10,951 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone 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

Capabilities
parse mathematical expressionsevaluate math formulas from stringsexpression parser evaluatormath expression simplificationvariable substitution mathtrigonometric function evaluatorsymbolic math expression
Topics
math-parserexpression-evaluatorformula-engine

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”

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

More Mathematics packages

networkx Worth it
PyPI · Python Modules · released Dec 2025

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.

BSD-3-Clausepure Python
290.9Mdownloads / mo
kiwisolver Worth it
PyPI · Mathematics · released Mar 2026

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.

BSD-3-Clausecompiled wheel · 3.10+
205.5Mdownloads / mo
sympy Worth it
PyPI · Scientific/Engineering · released Apr 2025

SymPy is a Python library for symbolic mathematics, performing algebraic manipulation, calculus, equation solving, and mathematical expression simplification without numerical approximation.

BSD-3-Clausepure Python · 3.9+
196.4Mdownloads / mo
contourpy Worth it
PyPI · Information Analysis · released Jul 2025

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.

BSD-3-Clausecompiled wheel · 3.11+
191.2Mdownloads / mo
torch With conditions
PyPI · Software Development · released Jul 2026

PyTorch provides GPU-accelerated tensor computation and automatic differentiation for building and training deep neural networks in Python.

Apache-2.0 AND Apache-2.0 WITH LLVM-exception AND BSD-2-Clause AND BSD-3-Clause AND BSL-1.0 AND MITcompiled wheel · 3.10+
102.5Mdownloads / mo
onnxruntime Worth it
PyPI · Software Development · released Jul 2026

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.

MITcompiled wheel · 3.11+
89.3Mdownloads / mo

See also asteval · jsonata-python · simpleeval · math-verify · leval · boolean.py · envsubst · pure-eval · tag-expressions · cel-expr-python