planemo.autopygen package

Subpackages

Submodules

planemo.autopygen.argument_parser_conversion module

Functions used to extract initialized ArgumentParser from target source code, and to transform it into easily usable ParamInfo class containing all the necessary info for ‘inputs’ element initialization

planemo.autopygen.argument_parser_conversion.command_from_decoy(parser: DecoyParser, data_inputs: Dict[str, str], reserved_names: Set[str], name_map: Dict[str, str], section_map: Dict[str, str], depth: int = 0, starting_namespace: str = '', skip_default_namespace: bool = False) str[source]

The function generates commands from decoy parser. It requires name and section maps that have already been initialised and contain correct mapping

planemo.autopygen.argument_parser_conversion.generate_xml_from_section(section: Section, data_inputs: Dict[str, str], reserved_names: Set[str], name_map: Dict[str, str], section_map: Dict[str, str], dont_wrap_in_section: bool = False) Tuple[List[_Element], List[Any], ParamInfo | None][source]
planemo.autopygen.argument_parser_conversion.obtain_and_convert_parser(path: str) DecoyParser | None[source]

Function parses python source code located at ‘path’, extracts initialized argument parser from the source file and returns it

Parameters

pathstr

path to the source file containing argument parser init

Returns

Initialized argument parser, or None, in case error happened

planemo.autopygen.argument_parser_conversion.obtain_and_convert_parser_from_str(text: str) ArgumentParser | None[source]

Function parses python source code stored in text and extracts argument parser

Parameters

textstr

variable containing target source code

Returns

Initialized argument parser, or None, in case error happened

planemo.autopygen.argument_parser_conversion.obtain_param_info(action: Action, data_inputs: Dict[str, str], reserved_names: Set[str], name_map: Dict[str, str], section_map: Dict[str, str]) ParamInfo[source]
planemo.autopygen.argument_parser_conversion.obtain_parser(tree: Module) DecoyParser | None[source]
planemo.autopygen.argument_parser_conversion.transform_section_name(section_name: str) str[source]
planemo.autopygen.argument_parser_conversion.update_name_map(name: str, name_map: Dict[str, str], reserved_names: Set[str])[source]

Updates names that are equal to one of the values in ‘reserved_names’ Doesn’t change names already present in the mapping

Parameters

name : name_map : reserved_names :

planemo.autopygen.argument_parser_conversion.xml_from_decoy(parser: DecoyParser, data_inputs: Dict[str, str], reserved_names: Set[str], name_map: Dict[str, str], section_map: Dict[str, str], dont_wrap_default_section: bool = True) Tuple[List[Any], List[Any], ParamInfo | None][source]
planemo.autopygen.argument_parser_conversion.xml_to_string(nodes: List[_Element], indent: int)[source]

planemo.autopygen.param_info module

class planemo.autopygen.param_info.ParamDataType(*values)[source]

Bases: Enum

BOOLEAN = 'boolean'
DATA = 'data'
FLOAT = 'float'
INTEGER = 'integer'
SELECT = 'select'
TEXT = 'text'
UNDEFINED = "##!_FIXME_!## argument uses complex type it's type cannot be determined"
class planemo.autopygen.param_info.ParamInfo(is_positional: bool, param_type: ParamTypeFlags, type: ParamDataType, name: str, argument: str, label: str, section: str, section_label: str, default_val: Any, custom_attributes: Dict[str, str], nargs: float | int = 0, help: str | None = None, optional: bool = False, choices: List[Any] | None = None, format: str | None = None)[source]

Bases: object

Class containing data of a single extracted parameter

argument: str
choices: List[Any] | None = None
custom_attributes: Dict[str, str]
default_val: Any
format: str | None = None
help: str | None = None
is_positional: bool
label: str
name: str
nargs: float | int = 0
optional: bool = False
param_type: ParamTypeFlags
section: str
section_label: str
type: ParamDataType
class planemo.autopygen.param_info.ParamTypeFlags(is_flag: bool = False, is_repeat: bool = False, is_selection: bool = False, is_extend: bool = False, is_version: bool = False, is_help: bool = False, is_output: bool = False)[source]

Bases: object

is_extend: bool = False
is_flag: bool = False
is_help: bool = False
is_output: bool = False
is_repeat: bool = False
is_selection: bool = False
is_version: bool = False

Module contents