Executing
Executing is a library for getting the currently executing AST node of a frame and other related information. The current version is 2.2.1, and it has a regular release cadence with updates addressing compatibility and performance.
Warnings
- breaking Post 2.1.0, there are breaking changes related to Python 3.12.5 source position handling.
- gotcha Ensure you are using Python 3.8 or later, as earlier versions are not supported.
Install
-
pip install executing
Imports
- get_ast_node
from executing import get_ast_node
Quickstart
from executing import get_ast_node
import os
node = get_ast_node(os.environ.get('FRAME', ''))
print(node)