addtermstovocab module

class addtermstovocab.AddTermsToVocabularyResource

Bases: Resource

methods: ClassVar[Optional[Collection[str]]] = {'POST'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

post()

takes a set of words and add them to a specific header’s vocabulary

Parameters:
  • header (str) – which vocabulary the terms will be added to.

  • new_vocabulary (list) – list of strings where each string is a new term

Returns:

errors – a list of errors associated with terms. empty if success.

Return type:

list

Examples

{

“header”:”species”, “new_vocabulary”:[“new species 1”,”new species 2”]

}