The artifacts produced by parse: 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 ParseResultConstruction
ParseResult 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.
document_json
@propertydef document_json(self) -> strThe content of document.json, or null when this run did not produce it.
Type: str
Read-only property.
document_md
@propertydef document_md(self) -> strThe content of document.md, or null when this run did not produce it.
Type: str
Read-only property.