Skip to content

response

pyDataverse.api.response

Enumeration of API response status values.

Attributes

NameTypeDescription
OKIndicates a successful API response.
ERRORIndicates an error occurred during the API request.

Base model for API responses from the Dataverse API.

This class represents the standard structure of responses returned by the Dataverse API, containing status information, data payload, and optional error messages.

Attributes

NameTypeDescription
statusStatusThe status of the API response (OK or ERROR).
datadictThe data payload returned by the API.
messageOptional[str]Optional message, typically used for error descriptions.

Methods

from_out_of_format(cls, data: dict | list, status_code: int) -> Self

Create an APIResponse from a dictionary or list.

This method is used to create an APIResponse from a dictionary or list.