Usage

API section.

ontobot_change_agent.api.get_issues(repository_name, token=None, title_search=None, label=None, number=0, state='open')

Get issues of specific states from a Github repository.

Parameters:
  • repository_name (str) – Name of the repository [org/repo]

  • token (Optional[str]) – Github token for authorization, defaults to None

  • title_search (Optional[str]) – Regex for title of the issue., defaults to None

  • label (Optional[str]) – Issue label, defaults to None

  • number (Optional[int]) – Issue number, defaults to 0

  • state (str) – State of the issue e.g. open, close etc., defaults to “open”

Yield:

Issue names that match the regex/label/number.

Return type:

Generator

ontobot_change_agent.api.get_comment_from_repo(repository_name, token=None, comment_id=0)

Get a comment from a Github repository.

ontobot_change_agent.api.get_all_labels_from_repo(repository_name, token=None)

Get all labels available in a repository for tagging issues on creation.

Parameters:
  • repository_name (str) – Name of the repository.

  • token (Optional[str]) – Github token for authorization, defaults to None

Return type:

dict

Returns:

A dictionary of {name: description}

ontobot_change_agent.api.process_issue_via_oak(input, commands, output=None)

Pass KGCL commands in the body to OAK.

Parameters:
  • input (str) – Path of resource to be worked on.

  • commands (list) – A list of commands.

  • output (Optional[str]) – Path to where the output is written, defaults to None

ontobot_change_agent.api.process_new_term_template(body, prefix)

Process an issue generated via new term request template.

Parameters:
  • body – Body of the issue.

  • prefix – Prefix of the ontology corresponding to the repository.

Returns:

Command list and body as a dict. If Issue does not match template: (None, None)

Raises:

ValueError – If prefix is absent.

ontobot_change_agent.api.process_issue_via_jar(input, commands, jar_path, output=None)

Pass KGCL commands in the body to kgcl-java.

Parameters:
  • input (str) – Path of resource to be worked on.

  • commands (list) – A list of commands.

  • output (Optional[str]) – Path to where the output is written, defaults to None

ontobot_change_agent.api.get_ontobot_implementers(token=None)

Get the implementers of ontobot-change-agent and update the README.md.

Parameters:

token (Optional[str]) – GitHub token for authorization, defaults to None.