tonita.corpora
#
- tonita.corpora.add(corpus_id, api_key=None)#
Add a corpus.
- Parameters:
corpus_id (str) – The ID of the corpus to add. This ID can only contain alphanumeric characters and underscores.
api_key (Optional[str]) – An API key. If this argument is
None
, then the value oftonita.api_key
will be used.
- Returns:
See docstring for AddCorpusResponse.
- Return type:
- Raises:
TonitaBadRequestError – The request is malformed; see error message for specifics.
TonitaInternalServerError – A server-side error occurred.
TonitaUnauthorizedError – The API key is missing or invalid.
ValueError – If the corpus ID contains characters that are not alphanumeric or underscores.
- tonita.corpora.list(api_key=None)#
List all available corpora.
- Parameters:
api_key (Optional[str]) – An API key. If this argument is
None
, then the value oftonita.api_key
will be used.- Returns:
See docstring for ListCorporaResponse.
- Return type:
- Raises:
TonitaInternalServerError – A server-side error occurred.
TonitaUnauthorizedError – The API key is missing or invalid.
- tonita.corpora.get(corpus_id, api_key=None)#
Get information about a corpus.
- Parameters:
corpus_id (str) – The ID of the corpus to get information for.
api_key (Optional[str]) – An API key. If this argument is
None
, then the value oftonita.api_key
will be used.
- Returns:
See docstring for GetCorpusResponse.
- Return type:
- Raises:
TonitaBadRequestError – The request is malformed; see error message for specifics.
TonitaInternalServerError – A server-side error occurred.
TonitaUnauthorizedError – The API key is missing or invalid.
- tonita.corpora.delete(corpus_id, api_key=None)#
Delete a corpus.
- Parameters:
corpus_id (str) – The ID of the corpus to delete.
api_key (Optional[str]) – An API key. If this argument is
None
, then the value oftonita.api_key
will be used.
- Returns:
See docstring for DeleteCorpusResponse.
- Return type:
- Raises:
TonitaBadRequestError – The request is malformed; see error message for specifics.
TonitaInternalServerError – A server-side error occurred.
TonitaUnauthorizedError – The API key is missing or invalid.
- tonita.corpora.recover(corpus_id, api_key=None)#
Recover a corpus that was previously marked to be deleted.
- Parameters:
corpus_id (str) – The ID of the corpus to recover.
api_key (Optional[str]) – An API key. If this argument is
None
, then the value oftonita.api_key
will be used.
- Returns:
See docstring for RecoverCorpusResponse.
- Return type:
- Raises:
TonitaBadRequestError – The request is malformed; see error message for specifics.
TonitaInternalServerError – A server-side error occurred.
TonitaUnauthorizedError – The API key is missing or invalid.