Skip to main content

Safely evaluates simple python expressions

Project description


Safely evaluate an expression from an untrusted party

Getting Started

Simply install via pip:

pip install safeeval


No dependencies are required.


Simple Comparision:

import safeeval
ast = safeeval.SafeEval.parse("x == y")
res = safeeval.SafeEval.evalAst(ast, {"x": 4, "y": 3)
print("res", res)


Write issues and provide patches via PRs on github.


See also the list of contributors who participated in this project.


This project is licensed under the MIT License - see the LICENSE file for details

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

safeeval-0.0.3.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

safeeval-0.0.3-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page