tcex.tcex_bin_validate module

TcEx Framework Validate Module.

class tcex.tcex_bin_validate.TcExValidate(_args)[source]

Bases: tcex.tcex_bin.TcExBin

Validate syntax, imports, and schemas.

  • Python and JSON file syntax
  • Python import modules
  • install.json schema
  • layout.json schema
Parameters:_args (namespace) – The argparser args Namespace.
static check_import_stdlib(module)[source]

Check if module is in Python stdlib.

Parameters:module (str) – The name of the module to check.
Returns:Returns True if the module is in the stdlib or template.
Return type:bool
static check_imported(module)[source]

Check whether the provide module can be imported (package installed).

Parameters:module (str) – The name of the module to check availability.
Returns:True if the module can be imported, False otherwise.
Return type:bool

Check the projects top level directory for missing imports.

This method will check only files ending in .py and does not handle imports validation for sub-directories.


Check all install.json files for valid schema.


Check all layout.json files for valid schema.


Check that the layout.json is consistent with install.json.

The layout.json files references the from the install.json file. The method will validate that no reference appear for inputs in install.json that don’t exist.


Run syntax on each “.py” and “.json” file.

Parameters:app_path (str, optional) – Defaults to None. The path of Python files.

Load install.json schema file.


Run in interactive mode.


Load layout.json schema file.


Print JSON output.


Print results.

static status_color(status)[source]

Return the appropriate status color.

static status_value(status)[source]

Return the appropriate status color.