← All projects
Project record1 mention
Originally shared on Hacker News

Customizable Python AST evaluation framework

A small Python library/framework for customising how the Python AST is walked and evaluated. It is intended to be used to configure a safe-ish sandboxed way of evaluating user-submitted expressions and code, and unlike existing alternatives it does not bake unwanted behavior into library internals.

Last shared For developers
01 / The problem

What it addresses

Existing libraries for sandboxed AST evaluation bake in internals the author didn't want, so a more customizable alternative is needed.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. Customizable Python AST evaluation framework

    A small Python library/framework for customising how the Python AST is walked and evaluated. It is intended to be used to configure a safe-ish sandboxed way of evaluating user-submitted expressions and code, and unlike existing alternatives it does not bake unwanted behavior into library internals.

    Problem: Existing libraries for sandboxed AST evaluation bake in internals the author didn't want, so a more customizable alternative is needed.

    Audience: developers

    Posted by @swarles · Original source ↗

    Source text · @swarles · · Source ↗

    A small Python library/framework for customising how the AST is walked and evaluated. I plan to use it in another project to configure a safe-ish sandboxed way of evaluating user submitted expressions and code.