galaxy.tool_util.toolbox.views package

Submodules

galaxy.tool_util.toolbox.views.definitions module

class galaxy.tool_util.toolbox.views.definitions.StaticToolBoxViewTypeEnum(value)[source]

Bases: str, Enum

An enumeration.

generic = 'generic'
activity = 'activity'
publication = 'publication'
training = 'training'
class galaxy.tool_util.toolbox.views.definitions.ExcludeTool(*, tool_id: str)[source]

Bases: BaseModel

tool_id: str
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'tool_id': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class galaxy.tool_util.toolbox.views.definitions.ExcludeToolRegex(*, tool_id_regex: str)[source]

Bases: BaseModel

tool_id_regex: str
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'tool_id_regex': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class galaxy.tool_util.toolbox.views.definitions.ExcludeTypes(*, types: List[str])[source]

Bases: BaseModel

types: List[str]
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'types': FieldInfo(annotation=List[str], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class galaxy.tool_util.toolbox.views.definitions.Tool(*, type: typing_extensions.Literal[tool] = 'tool', id: str)[source]

Bases: BaseModel

content_type: typing_extensions.Literal[tool]
id: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_fields: ClassVar[dict[str, FieldInfo]] = {'content_type': FieldInfo(annotation=Literal['tool'], required=False, default='tool', alias='type', alias_priority=2), 'id': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class galaxy.tool_util.toolbox.views.definitions.Label(*, type: typing_extensions.Literal[label] = 'label', id: str | None = None, text: str)[source]

Bases: BaseModel

content_type: typing_extensions.Literal[label]
id: str | None
text: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_fields: ClassVar[dict[str, FieldInfo]] = {'content_type': FieldInfo(annotation=Literal['label'], required=False, default='label', alias='type', alias_priority=2), 'id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'text': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class galaxy.tool_util.toolbox.views.definitions.LabelShortcut(*, content_type: typing_extensions.Literal[simple_label] = 'simple_label', label: str)[source]

Bases: BaseModel

content_type: typing_extensions.Literal[simple_label]
label: str
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'content_type': FieldInfo(annotation=Literal['simple_label'], required=False, default='simple_label'), 'label': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class galaxy.tool_util.toolbox.views.definitions.Workflow(*, type: typing_extensions.Literal[workflow] = 'workflow', id: str)[source]

Bases: BaseModel

content_type: typing_extensions.Literal[workflow]
id: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_fields: ClassVar[dict[str, FieldInfo]] = {'content_type': FieldInfo(annotation=Literal['workflow'], required=False, default='workflow', alias='type', alias_priority=2), 'id': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class galaxy.tool_util.toolbox.views.definitions.ItemsFrom(*, content_type: typing_extensions.Literal[items_from] = 'items_from', items_from: str, excludes: List[ExcludeTool | ExcludeToolRegex | ExcludeTypes] | None = None)[source]

Bases: BaseModel

content_type: typing_extensions.Literal[items_from]
items_from: str
excludes: List[galaxy.tool_util.toolbox.views.definitions.ExcludeTool | galaxy.tool_util.toolbox.views.definitions.ExcludeToolRegex | galaxy.tool_util.toolbox.views.definitions.ExcludeTypes] | None[List[ExcludeTool | ExcludeToolRegex | ExcludeTypes] | None]
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'content_type': FieldInfo(annotation=Literal['items_from'], required=False, default='items_from'), 'excludes': FieldInfo(annotation=Union[List[Union[galaxy.tool_util.toolbox.views.definitions.ExcludeTool, galaxy.tool_util.toolbox.views.definitions.ExcludeToolRegex, galaxy.tool_util.toolbox.views.definitions.ExcludeTypes]], NoneType], required=False, default=None), 'items_from': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class galaxy.tool_util.toolbox.views.definitions.HasItems[source]

Bases: object

items: List[Any] | None
property items_expanded: List[Section | SectionAlias | Tool | Label | Workflow | ItemsFrom] | None
class galaxy.tool_util.toolbox.views.definitions.Section(*, items: List[Tool | Label | LabelShortcut | Workflow | ItemsFrom] | None = None, type: typing_extensions.Literal[section], id: str | None = None, name: str | None = None, excludes: List[ExcludeTool | ExcludeToolRegex | ExcludeTypes] | None = None)[source]

Bases: BaseModel, HasItems

content_type: typing_extensions.Literal[section]
id: str | None
name: str | None
items: List[Tool | Label | LabelShortcut | Workflow | ItemsFrom] | None
excludes: List[galaxy.tool_util.toolbox.views.definitions.ExcludeTool | galaxy.tool_util.toolbox.views.definitions.ExcludeToolRegex | galaxy.tool_util.toolbox.views.definitions.ExcludeTypes] | None[List[ExcludeTool | ExcludeToolRegex | ExcludeTypes] | None]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_fields: ClassVar[dict[str, FieldInfo]] = {'content_type': FieldInfo(annotation=Literal['section'], required=True, alias='type', alias_priority=2), 'excludes': FieldInfo(annotation=Union[List[Union[galaxy.tool_util.toolbox.views.definitions.ExcludeTool, galaxy.tool_util.toolbox.views.definitions.ExcludeToolRegex, galaxy.tool_util.toolbox.views.definitions.ExcludeTypes]], NoneType], required=False, default=None), 'id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'items': FieldInfo(annotation=Union[List[Union[galaxy.tool_util.toolbox.views.definitions.Tool, galaxy.tool_util.toolbox.views.definitions.Label, galaxy.tool_util.toolbox.views.definitions.LabelShortcut, galaxy.tool_util.toolbox.views.definitions.Workflow, galaxy.tool_util.toolbox.views.definitions.ItemsFrom]], NoneType], required=False, default=None), 'name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class galaxy.tool_util.toolbox.views.definitions.SectionAlias(*, content_type: typing_extensions.Literal[section_alias] = 'section_alias', section: str, excludes: List[ExcludeTool | ExcludeToolRegex | ExcludeTypes] | None = None)[source]

Bases: BaseModel

content_type: typing_extensions.Literal[section_alias]
section: str
excludes: List[galaxy.tool_util.toolbox.views.definitions.ExcludeTool | galaxy.tool_util.toolbox.views.definitions.ExcludeToolRegex | galaxy.tool_util.toolbox.views.definitions.ExcludeTypes] | None[List[ExcludeTool | ExcludeToolRegex | ExcludeTypes] | None]
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'content_type': FieldInfo(annotation=Literal['section_alias'], required=False, default='section_alias'), 'excludes': FieldInfo(annotation=Union[List[Union[galaxy.tool_util.toolbox.views.definitions.ExcludeTool, galaxy.tool_util.toolbox.views.definitions.ExcludeToolRegex, galaxy.tool_util.toolbox.views.definitions.ExcludeTypes]], NoneType], required=False, default=None), 'section': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class galaxy.tool_util.toolbox.views.definitions.SectionAliases(*, content_type: typing_extensions.Literal[section_aliases] = 'section_aliases', sections: List[str], excludes: List[ExcludeTool | ExcludeToolRegex | ExcludeTypes] | None = None)[source]

Bases: BaseModel

content_type: typing_extensions.Literal[section_aliases]
sections: List[str]
excludes: List[galaxy.tool_util.toolbox.views.definitions.ExcludeTool | galaxy.tool_util.toolbox.views.definitions.ExcludeToolRegex | galaxy.tool_util.toolbox.views.definitions.ExcludeTypes] | None[List[ExcludeTool | ExcludeToolRegex | ExcludeTypes] | None]
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'content_type': FieldInfo(annotation=Literal['section_aliases'], required=False, default='section_aliases'), 'excludes': FieldInfo(annotation=Union[List[Union[galaxy.tool_util.toolbox.views.definitions.ExcludeTool, galaxy.tool_util.toolbox.views.definitions.ExcludeToolRegex, galaxy.tool_util.toolbox.views.definitions.ExcludeTypes]], NoneType], required=False, default=None), 'sections': FieldInfo(annotation=List[str], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class galaxy.tool_util.toolbox.views.definitions.StaticToolBoxView(*, items: List[Section | SectionAlias | SectionAliases | Tool | Label | LabelShortcut | Workflow | ItemsFrom] | None = None, id: str, name: str, description: str | None = None, type: StaticToolBoxViewTypeEnum, excludes: List[ExcludeTool | ExcludeToolRegex | ExcludeTypes] | None = None)[source]

Bases: BaseModel, HasItems

id: str
name: str
description: str | None
view_type: StaticToolBoxViewTypeEnum
items: List[Section | SectionAlias | SectionAliases | Tool | Label | LabelShortcut | Workflow | ItemsFrom] | None
excludes: List[galaxy.tool_util.toolbox.views.definitions.ExcludeTool | galaxy.tool_util.toolbox.views.definitions.ExcludeToolRegex | galaxy.tool_util.toolbox.views.definitions.ExcludeTypes] | None[List[ExcludeTool | ExcludeToolRegex | ExcludeTypes] | None]
static from_dict(as_dict)[source]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_fields: ClassVar[dict[str, FieldInfo]] = {'description': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'excludes': FieldInfo(annotation=Union[List[Union[galaxy.tool_util.toolbox.views.definitions.ExcludeTool, galaxy.tool_util.toolbox.views.definitions.ExcludeToolRegex, galaxy.tool_util.toolbox.views.definitions.ExcludeTypes]], NoneType], required=False, default=None), 'id': FieldInfo(annotation=str, required=True), 'items': FieldInfo(annotation=Union[List[Union[galaxy.tool_util.toolbox.views.definitions.Section, galaxy.tool_util.toolbox.views.definitions.SectionAlias, galaxy.tool_util.toolbox.views.definitions.SectionAliases, galaxy.tool_util.toolbox.views.definitions.Tool, galaxy.tool_util.toolbox.views.definitions.Label, galaxy.tool_util.toolbox.views.definitions.LabelShortcut, galaxy.tool_util.toolbox.views.definitions.Workflow, galaxy.tool_util.toolbox.views.definitions.ItemsFrom]], NoneType], required=False, default=None), 'name': FieldInfo(annotation=str, required=True), 'view_type': FieldInfo(annotation=StaticToolBoxViewTypeEnum, required=True, alias='type', alias_priority=2)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

galaxy.tool_util.toolbox.views.edam module

class galaxy.tool_util.toolbox.views.edam.EdamPanelMode(value)[source]

Bases: str, Enum

An enumeration.

merged = 'merged'
topics = 'topics'
operations = 'operations'
class galaxy.tool_util.toolbox.views.edam.EdamToolPanelView(edam: Dict[str, Dict], mode: EdamPanelMode = EdamPanelMode.merged)[source]

Bases: ToolPanelView

__init__(edam: Dict[str, Dict], mode: EdamPanelMode = EdamPanelMode.merged)[source]
apply_view(base_tool_panel: ToolPanelElements, toolbox_registry: ToolBoxRegistry) ToolPanelElements[source]

Consume tool panel state and return custom tool panel view.

to_model() ToolPanelViewModel[source]

Convert abstract description to dictionary description to emit via the API.

galaxy.tool_util.toolbox.views.interface module

class galaxy.tool_util.toolbox.views.interface.ToolPanelViewModelType(value)[source]

Bases: str, Enum

An enumeration.

default_type = 'default'
generic = 'generic'
activity = 'activity'
ontology = 'ontology'
publication = 'publication'
training = 'training'
class galaxy.tool_util.toolbox.views.interface.ToolPanelViewModel(*, id: str, model_class: str, name: str, description: str | None = None, view_type: ToolPanelViewModelType, searchable: bool)[source]

Bases: BaseModel

A view of ToolPanelView objects serialized for the API.

id: str
model_class: str
name: str
description: str | None
view_type: ToolPanelViewModelType
searchable: bool
model_config: ClassVar[ConfigDict] = {'protected_namespaces': ()}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_fields: ClassVar[dict[str, FieldInfo]] = {'description': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'id': FieldInfo(annotation=str, required=True), 'model_class': FieldInfo(annotation=str, required=True), 'name': FieldInfo(annotation=str, required=True), 'searchable': FieldInfo(annotation=bool, required=True), 'view_type': FieldInfo(annotation=ToolPanelViewModelType, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class galaxy.tool_util.toolbox.views.interface.ToolBoxRegistry[source]

Bases: object

View of ToolBox provided to ToolPanelView to reason about tools loaded.

abstract has_tool(tool_id: str) bool[source]

Return bool indicating if tool with specified id is loaded.

abstract get_tool(tool_id: str)[source]

Return tool with supplied tool id.

abstract get_workflow(id: str)[source]

Return workflow from panel with supplied id.

abstract add_tool_to_tool_panel_view(tool, tool_panel_component: HasPanelItems) None[source]

Add tool to the tool panel view component (root or section).

class galaxy.tool_util.toolbox.views.interface.ToolPanelView[source]

Bases: object

abstract apply_view(base_tool_panel: ToolPanelElements, toolbox_registry: ToolBoxRegistry) ToolPanelElements[source]

Consume tool panel state and return custom tool panel view.

abstract to_model() ToolPanelViewModel[source]

Convert abstract description to dictionary description to emit via the API.

galaxy.tool_util.toolbox.views.interface.walk_loaded_tools(tool_panel: ToolPanelElements, toolbox_registry: ToolBoxRegistry)[source]

galaxy.tool_util.toolbox.views.sources module

class galaxy.tool_util.toolbox.views.sources.StaticToolBoxViewSources(view_directories=None, view_dicts=None)[source]

Bases: object

__init__(view_directories=None, view_dicts=None)[source]
view_directories: List[str]
view_dicts: List[Dict]
get_definitions() List[StaticToolBoxView][source]
galaxy.tool_util.toolbox.views.sources.looks_like_view_source_filename(filename: str) bool[source]

galaxy.tool_util.toolbox.views.static module

galaxy.tool_util.toolbox.views.static.build_filter(excludes_)[source]
class galaxy.tool_util.toolbox.views.static.StaticToolPanelView(definition: StaticToolBoxView)[source]

Bases: ToolPanelView

__init__(definition: StaticToolBoxView)[source]
apply_view(base_tool_panel: ToolPanelElements, toolbox_registry: ToolBoxRegistry) ToolPanelElements[source]

Consume tool panel state and return custom tool panel view.

to_model() ToolPanelViewModel[source]

Convert abstract description to dictionary description to emit via the API.