Recipe Metadata#

This section describes the recipe_metadata submodule of the API (esmvalcore.experimental).

API reference#

API for recipe metadata.

Classes:

Contributor(name, institute[, orcid])

Contains contributor (author or maintainer) information.

Project(project)

Use this class to acknowledge a project associated with the recipe.

Reference(filename)

Parse reference information from bibtex entries.

Exceptions:

RenderError

Error during rendering of object.

class esmvalcore.experimental.recipe_metadata.Contributor(name: str, institute: str, orcid: str | None = None)[source]#

Bases: object

Contains contributor (author or maintainer) information.

Parameters:
  • name (str) – Name of the author, i.e. 'John Doe'

  • institute (str) – Name of the institute

  • orcid (str, optional) – ORCID url

Methods:

from_dict(attributes)

Return an instance of Contributor from a dictionary.

from_tag(tag)

Return an instance of Contributor from a tag (TAGS).

classmethod from_dict(attributes)[source]#

Return an instance of Contributor from a dictionary.

Parameters:

attributes (dict) – Dictionary containing name / institute [/ orcid].

classmethod from_tag(tag: str) Contributor[source]#

Return an instance of Contributor from a tag (TAGS).

Parameters:

tag (str) – The contributor tags are defined in the authors section in config-references.yml.

Return type:

Contributor

class esmvalcore.experimental.recipe_metadata.Project(project: str)[source]#

Bases: object

Use this class to acknowledge a project associated with the recipe.

Parameters:

project (str) – The project title.

Methods:

from_tag(tag)

Return an instance of Project from a tag (TAGS).

classmethod from_tag(tag: str) Project[source]#

Return an instance of Project from a tag (TAGS).

Parameters:

tag (str) – The project tags are defined in config-references.yml.

Return type:

Project

class esmvalcore.experimental.recipe_metadata.Reference(filename: str)[source]#

Bases: object

Parse reference information from bibtex entries.

Parameters:

filename (str) – Name of the bibtex file.

Raises:

NotImplementedError – If the bibtex file contains more than 1 entry.

Methods:

from_tag(tag)

Return an instance of Reference from a bibtex tag.

render([renderer])

Render the reference.

classmethod from_tag(tag: str) Reference[source]#

Return an instance of Reference from a bibtex tag.

Parameters:

tag (str) – The bibtex tags resolved as esmvaltool/references/{tag}.bibtex or the corresponding directory as defined by the diagnostics path.

Return type:

Reference

render(renderer: str = 'html') str[source]#

Render the reference.

Parameters:

renderer (str) – Choose the renderer for the string representation. Must be one of: ‘plaintext’, ‘markdown’, ‘html’, ‘latex’

Returns:

Rendered reference

Return type:

str

exception esmvalcore.experimental.recipe_metadata.RenderError[source]#

Bases: BaseException

Error during rendering of object.

add_note()#

Exception.add_note(note) – add a note to the exception

args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.