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: str | List[str], description: str | None = None, info: str | None = None)[source]#

Bases: object

Defines a ProjectTemplate that plugins can define.

name: str#
url: str | List[str]#
description: str = None#
info: str = None#
static read_templates_from_json_stream(s) List[ProjectTemplate][source]#

Read Project Template from stream.

Parameters:

s – Stream where json data resides

Returns:

Templates loaded from json

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

Bases: object

Base class for all plugins.

classmethod get_name(strip_all: bool = True) str[source]#

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[source]#

Get a brief description of the plugin and its functionality.

Returns:

The plugin description.

get_project_templates() List[ProjectTemplate][source]#

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

Returns:

List of project templates

get_example_urls() List[str][source]#

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][source]#

Returns a dictionary of topics and links to help.

Returns:

Dict of help urls

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

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[source]#

Returns the version of the plugin.

Returns:

Version for the plugin