Skip to content

Latest commit

 

History

History
100 lines (54 loc) · 5.59 KB

File metadata and controls

100 lines (54 loc) · 5.59 KB
graph LR
    glom_cli_console_main["glom.cli.console_main"]
    glom_cli_main["glom.cli.main"]
    glom_cli_get_command["glom.cli.get_command"]
    glom_cli_mw_get_target["glom.cli.mw_get_target"]
    glom_cli_mw_handle_target["glom.cli.mw_handle_target"]
    glom_cli__eval_python_full_spec["glom.cli._eval_python_full_spec"]
    glom_cli__compile_code["glom.cli._compile_code"]
    glom_cli__from_glom_import_star["glom.cli._from_glom_import_star"]
    glom_cli_console_main -- "invokes" --> glom_cli_main
    glom_cli_main -- "delegates to" --> glom_cli_get_command
    glom_cli_main -- "invokes" --> glom_cli_mw_get_target
    glom_cli_mw_get_target -- "calls" --> glom_cli__eval_python_full_spec
    glom_cli__eval_python_full_spec -- "depends on" --> glom_cli__compile_code
    glom_cli__eval_python_full_spec -- "depends on" --> glom_cli__from_glom_import_star
    glom_cli_mw_get_target -- "passes data to" --> glom_cli_mw_handle_target
Loading

CodeBoardingDemoContact

Details

The CLI Interface subsystem is primarily defined by the glom.cli package, with its core functionality centered around the glom.cli.main function and related components within the /mnt/e/StartUp/glom/glom/cli.py file. It acts as the external entry point for users to interact with glom, handling argument parsing and initiating the data transformation process. The CLI Interface subsystem operates as a pipeline, starting with console_main as the entry point. main orchestrates the flow, first parsing user input via get_command. It then proceeds to retrieve and evaluate the target data/specification using mw_get_target. This retrieval often involves dynamic execution of Python code, facilitated by _eval_python_full_spec, which in turn relies on _compile_code for compilation and _from_glom_import_star for environment setup. Finally, mw_handle_target processes the evaluated target, preparing it for the core glom transformation engine (which is external to this specific CLI subsystem). This structure effectively separates argument handling and dynamic evaluation concerns within the CLI.

glom.cli.console_main

The absolute top-level entry point for the glom command-line application. It initiates the entire CLI execution flow.

Related Classes/Methods:

glom.cli.main

The central orchestrator of the CLI. It coordinates the overall process, including argument parsing, command dispatch, and high-level error handling.

Related Classes/Methods:

glom.cli.get_command

Responsible for parsing command-line arguments provided by the user, interpreting them to determine the specific glom operation or transformation requested.

Related Classes/Methods:

glom.cli.mw_get_target

A middleware component focused on retrieving and evaluating the target data or specification. This often involves dynamic evaluation of Python expressions provided via the command line.

Related Classes/Methods:

glom.cli.mw_handle_target

A middleware component that processes the target data or specification after it has been obtained and evaluated. It prepares the data/spec for consumption by the core glom transformation engine.

Related Classes/Methods:

glom.cli._eval_python_full_spec

Handles the dynamic evaluation of Python code or specifications provided as strings. This is crucial for glom's flexibility, allowing users to define complex transformations directly in the CLI.

Related Classes/Methods:

glom.cli._compile_code

A utility function that compiles raw Python code strings into executable code objects, a prerequisite for dynamic evaluation.

Related Classes/Methods:

glom.cli._from_glom_import_star

A helper function that sets up the execution environment for dynamically evaluated Python code. It ensures that glom's core functionalities (e.g., glom function, T) are available within the scope of the evaluated code.

Related Classes/Methods: