idmtools.registry.plugin_specification module

Defines our base plugin definition and specifications.

Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.

class idmtools.registry.plugin_specification.ProjectTemplate(name: str, url: Union[str, List[str]], description: Optional[str] = None, info: Optional[str] = None)

Bases: object

Defines a ProjectTemplate that plugins can define.

name: str
url: Union[str, List[str]]
description: str = None
info: str = None
static read_templates_from_json_stream(s) List[ProjectTemplate]

Read Project Template from stream.

Parameters:

s – Stream where json data resides

Returns:

Templates loaded from json

__init__(name: str, url: Union[str, List[str]], description: Optional[str] = None, info: Optional[str] = None) None
class idmtools.registry.plugin_specification.PluginSpecification

Bases: object

Base class for all plugins.

classmethod get_name(strip_all: bool = True) str

Get the name of the plugin. Although it can be overridden, the best practice is to use the class name as the plugin name.

Returns:

The name of the plugin as a string.

get_description() str

Get a brief description of the plugin and its functionality.

Returns:

The plugin description.

get_project_templates() List[ProjectTemplate]

Returns a list of project templates related to the a plugin.

Returns:

List of project templates

get_example_urls() List[str]

Returns a list of URLs that a series of Examples for plugin can be downloaded from.

Returns:

List of urls

get_help_urls() Dict[str, str]

Returns a dictionary of topics and links to help.

Returns:

Dict of help urls

static get_version_url(version: str, extra: Optional[str] = None, repo_base_url: str = 'https://github.com/InstituteforDiseaseModeling/idmtools/tree/', nightly_branch: str = 'dev')

Build a url using version.

Here we assume the tag will exist for that specific version :param version: Version to look up. If it contains nightly, we default to nightly_branch :param extra: Extra parts of url pass base :param repo_base_url: Optional url :param nightly_branch: default to dev

Returns:

URL for item

get_version() str

Returns the version of the plugin.

Returns:

Version for the plugin