pure-eval
Safely evaluate AST nodes without side effects
Install
pure-eval on PyPI
pip
pip install pure-evaluv
uv add pure-evalpoetry
poetry add pure-evalPackage facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 753 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: pure_eval-0.2.3-py3-none-any.whl
About pure-eval
from the package's own PyPI description — quoted content, verbatim
pure_eval
Build Status (image) Coverage Status (image) Supports Python versions 3.7+ (image)
This is a Python package that lets you safely evaluate certain AST nodes without triggering arbitrary code that may have unwanted side effects.
It can be installed from PyPI:
pip install pure_eval
To demonstrate usage, suppose we have an object defined as follows:
class Rectangle:
def __init__(self, width, height):
self.width = width
self.height = height
@property
def area(self):
print("Calculating area...")
return self.width * self.height
rect = Rectangle(3, 5)
Given the rect object, we want to evaluate whatever expressions we can in this source code:
source = "(rect.width, rect.height, rect.area)"
This library works with the AST, so let's parse the source code and...
Read as markdown · JSON record · Source repository · Homepage
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
Safely evaluates Python AST nodes without triggering side effects, allowing you to extract values from expressions while refusing to execute properties, function calls, or other code with unknown behavior.
Minimal friction: pure Python wheel with zero runtime dependencies and low install overhead. Aging maintenance status (753 days since last release) but repository remains active with recent commit history.
MIT license permits unrestricted use, modification, and distribution in both open and proprietary projects with minimal obligations.
Usage
pip install pure_eval
import ast
from pure_eval import Evaluator
tree = ast.parse("x + 1")
evaluator = Evaluator({"x": 5})
for node, value in evaluator.find_expressions(tree):
print(value)
Verdict: A lightweight, stable utility for safe AST evaluation with no dependencies and permissive licensing. Aging maintenance (last release July 2024) is offset by active repository and zero known vulnerabilities. Well-suited for debuggers, REPLs, and introspection tools that need to inspect code without executing arbitrary logic.
Needs verification
- Whether the 753-day gap between releases reflects stable maturity or insufficient maintenance attention for emerging Python versions
- Real-world adoption patterns beyond the top-1000 tier classification
Similar packages
permissive · top 1,000 on PyPI
executingpermissive · top 1,000 on PyPI
google-pastapermissive · top 1,000 on PyPI
jsonpath-ngpermissive · top 1,000 on PyPI
eval-type-backportpermissive · top 1,000 on PyPI
stack-datapermissive · top 1,000 on PyPI
tree-sitterpermissive · top 1,000 on PyPI
astroidcopyleft · top 1,000 on PyPI
pydantic-graphpermissive · top 1,000 on PyPI
pyflakespermissive · top 1,000 on PyPI