The artifacts produced by extract: the same files, under the same names and with the same content, that the hosted service returns for the same request.
from nutrient_sdk import ExtractResultConstruction
ExtractResult cannot be instantiated directly. Obtain instances through static factory methods or via other SDK classes.
Methods
get_artifact
def get_artifact(self, name: str) -> strReturns the content of an artifact, exactly as the run produced it.
Parameters:
| Name | Type | Description |
|---|---|---|
name | str | The artifact file name, for example document.json. |
Returns: str - The artifact content. Raises:
NullOrEmptyParameterException: Thrown whennameis null or empty.InvalidArgumentException: Thrown when this run did not produce that artifact.
has_artifact
def has_artifact(self, name: str) -> boolWhether this run produced an artifact with the given file name.
Parameters:
| Name | Type | Description |
|---|---|---|
name | str | The artifact file name, for example document.json. |
Returns: bool - True when the artifact was produced.
save_to
def save_to(self, directory: str) -> NoneWrites every artifact into a directory under its own file name, creating the directory when needed and replacing files that already exist.
Parameters:
| Name | Type | Description |
|---|---|---|
directory | str | The directory to write into. |
Raises:
NullOrEmptyParameterException: Thrown whendirectoryis null or empty.InvalidArgumentException: Thrown when an artifact name is not a plain file name.
Properties
artifact_names
@propertydef artifact_names(self) -> listThe file names of the artifacts this run produced, sorted.
Type: list
Read-only property.
confidence_json
@propertydef confidence_json(self) -> strThe content of confidence.json, or null when this run did not produce it.
Type: str
Read-only property.
diagnostics_json
@propertydef diagnostics_json(self) -> strThe content of diagnostics.json, or null when this run did not produce it.
Type: str
Read-only property.
result_json
@propertydef result_json(self) -> strThe content of result.json, or null when this run did not produce it.
Type: str
Read-only property.
warnings_json
@propertydef warnings_json(self) -> strThe content of warnings.json, or null when this run did not produce it.
Type: str
Read-only property.