Safeeval
Safely evaluate simple expressions from untrusted sources
Install / Use
/learn @viur-framework/SafeevalREADME
safeeval
Safely evaluate an expression from an untrusted party
Getting Started
Simply install via pip:
pip install safeeval
Prerequisites
No dependencies are required.
Example
Simple Comparision:
import safeeval
ast = safeeval.SafeEval.parse("x == y")
res = safeeval.SafeEval.evalAst(ast, {"x": 4, "y": 3)
print("res", res)
More examples can be found in tests directory.
Contributing
Write issues and provide patches via PRs on github.
Authors
- Tobias Steinrücken - Initial work - Mausbrand Informationsysteme GmbH
- Stefan Kögl - Packaging, callable support, docstrings - Mausbrand Informationsysteme GmbH
See also the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE file for details
Related Skills
node-connect
337.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
337.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.3kCommit, push, and open a PR
