Skip to content

CPython AST Scanner

Extracts symbol values from .py files using Python's native AST parser via astpretty.

When no Python runtime is available, set pythonPath to empty/null to fall back to ANTLR python parsing.

Configuration

To configure the CPython AST scanner module, Edit these settings.

Below is the default configuration from: pythonAST/default.yaml.

Edit Online

Edit default.yaml Locally

# 🔟❎ 'compile' python symbol scanner settings

# The Python AST symbol scanner leverages the Python native .py parsing engine.
# to launch the 'astpretty' script from https://github.com/asottile/astpretty 
# to parse the contents of an input .py file. 

# If a python runtime is unavailable when executing the 'compile' pipeline,
# the 'pythonASTPath' value can be set to null or empty string to default 
# to the ANTLR symbol scanner defined in 'python.yaml'

# 'pythonPath' specifies the command for launching a Python run-time. 
#  A test script verifies a Python run-time is available. If the test script is unsuccessful,
#  the scanner is disabled. 
pythonPath: python3

Options

Specify the options below to configure the CPython AST scanner:

Name Description
pythonPath Command to be used to launch Python program

pythonPath

Command to be used to launch Python program.

Type Default
String python3

Specifies the command for launching a Python run-time. A test script verifies a Python run-time is available. If the test script is unsuccessful, the scanner is disabled.


This module is defined in pythonAST/module.yaml.