Skip to main content

ASTEVAL provides a numpy-aware, safe(ish) ‘eval’ function

Emphasis is on mathematical expressions, and so numpy ufuncs are used if available. Symbols are held in the Interpreter symbol table ‘symtable’: a simple dictionary supporting a simple, flat namespace.

Expressions can be compiled into ast node for later evaluation, using the values in the symbol table current at evaluation time.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page