Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/google-cloud-documentai/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ Running System Tests
$ nox -s system

# Run a single system test
$ nox -s system- -- -k <name of test>
$ nox -s system-3.11 -- -k <name of test>


.. note::

System tests are only configured to run under Python.
System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11.
For expediency, we do not run them in older versions of Python 3.

This alone will not run the tests. You'll need to change some local
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ DocumentService
.. automodule:: google.cloud.documentai_v1beta3.services.document_service
:members:
:inherited-members:

.. automodule:: google.cloud.documentai_v1beta3.services.document_service.pagers
:members:
:inherited-members:
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.19.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.19.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class RawDocument(proto.Message):
The display name of the document, it supports all Unicode
characters except the following: ``*``, ``?``, ``[``, ``]``,
``%``, ``{``, ``}``,\ ``'``, ``\"``, ``,`` ``~``, ``=`` and
``:`` are reserved. If not specified, a default ID will be
``:`` are reserved. If not specified, a default ID is
generated.
"""

Expand Down Expand Up @@ -260,8 +260,16 @@ class OcrConfig(proto.Message):
Includes symbol level OCR information if set
to true.
compute_style_info (bool):
Turn on font id model and returns font style information.
Use PremiumFeatures.compute_style_info instead.
Turn on font identification model and return font style
information. Deprecated, use
[PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info]
instead.
disable_character_boxes_detection (bool):
Turn off character box detector in OCR
engine. Character box detection is enabled by
default in OCR 2.0+ processors.
premium_features (google.cloud.documentai_v1.types.OcrConfig.PremiumFeatures):
Configurations for premium OCR features.
"""

class Hints(proto.Message):
Expand All @@ -285,6 +293,34 @@ class Hints(proto.Message):
number=1,
)

class PremiumFeatures(proto.Message):
r"""Configurations for premium OCR features.

Attributes:
enable_selection_mark_detection (bool):
Turn on selection mark detector in OCR
engine. Only available in OCR 2.0+ processors.
compute_style_info (bool):
Turn on font identification model and return
font style information.
enable_math_ocr (bool):
Turn on the model that can extract LaTeX math
formulas.
"""

enable_selection_mark_detection: bool = proto.Field(
proto.BOOL,
number=3,
)
compute_style_info: bool = proto.Field(
proto.BOOL,
number=4,
)
enable_math_ocr: bool = proto.Field(
proto.BOOL,
number=5,
)

hints: Hints = proto.Field(
proto.MESSAGE,
number=2,
Expand All @@ -310,6 +346,15 @@ class Hints(proto.Message):
proto.BOOL,
number=8,
)
disable_character_boxes_detection: bool = proto.Field(
proto.BOOL,
number=10,
)
premium_features: PremiumFeatures = proto.Field(
proto.MESSAGE,
number=11,
message=PremiumFeatures,
)


__all__ = tuple(sorted(__protobuf__.manifest))
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,63 @@
class ProcessOptions(proto.Message):
r"""Options for Process API

This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.

.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

Attributes:
individual_page_selector (google.cloud.documentai_v1.types.ProcessOptions.IndividualPageSelector):
Which pages to process (1-indexed).

This field is a member of `oneof`_ ``page_range``.
from_start (int):
Only process certain pages from the start.
Process all if the document has fewer pages.

This field is a member of `oneof`_ ``page_range``.
from_end (int):
Only process certain pages from the end, same
as above.

This field is a member of `oneof`_ ``page_range``.
ocr_config (google.cloud.documentai_v1.types.OcrConfig):
Only applicable to ``OCR_PROCESSOR``. Returns error if set
on other processor types.
"""

class IndividualPageSelector(proto.Message):
r"""A list of individual page numbers.

Attributes:
pages (MutableSequence[int]):
Optional. Indices of the pages (starting from
1).
"""

pages: MutableSequence[int] = proto.RepeatedField(
proto.INT32,
number=1,
)

individual_page_selector: IndividualPageSelector = proto.Field(
proto.MESSAGE,
number=5,
oneof="page_range",
message=IndividualPageSelector,
)
from_start: int = proto.Field(
proto.INT32,
number=6,
oneof="page_range",
)
from_end: int = proto.Field(
proto.INT32,
number=7,
oneof="page_range",
)
ocr_config: document_io.OcrConfig = proto.Field(
proto.MESSAGE,
number=1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.19.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -90,27 +90,37 @@
UndeployProcessorVersionRequest,
UndeployProcessorVersionResponse,
)
from .types.document_schema import DocumentSchema, EntityTypeMetadata, PropertyMetadata
from .types.document_schema import (
DocumentSchema,
EntityTypeMetadata,
FieldExtractionMetadata,
PropertyMetadata,
SummaryOptions,
)
from .types.document_service import (
BatchDeleteDocumentsMetadata,
BatchDeleteDocumentsRequest,
BatchDeleteDocumentsResponse,
DatasetSplitType,
DocumentLabelingState,
DocumentMetadata,
DocumentPageRange,
GetDatasetSchemaRequest,
GetDocumentRequest,
GetDocumentResponse,
ImportDocumentsMetadata,
ImportDocumentsRequest,
ImportDocumentsResponse,
ListDocumentsRequest,
ListDocumentsResponse,
UpdateDatasetOperationMetadata,
UpdateDatasetRequest,
UpdateDatasetSchemaRequest,
)
from .types.evaluation import Evaluation, EvaluationReference
from .types.geometry import BoundingPoly, NormalizedVertex, Vertex
from .types.operation_metadata import CommonOperationMetadata
from .types.processor import Processor, ProcessorVersion
from .types.processor import Processor, ProcessorVersion, ProcessorVersionAlias
from .types.processor_type import ProcessorType

__all__ = (
Expand Down Expand Up @@ -143,6 +153,8 @@
"DisableProcessorResponse",
"Document",
"DocumentId",
"DocumentLabelingState",
"DocumentMetadata",
"DocumentOutputConfig",
"DocumentPageRange",
"DocumentProcessorServiceClient",
Expand All @@ -159,6 +171,7 @@
"EvaluationReference",
"FetchProcessorTypesRequest",
"FetchProcessorTypesResponse",
"FieldExtractionMetadata",
"GcsDocument",
"GcsDocuments",
"GcsPrefix",
Expand All @@ -176,6 +189,8 @@
"ImportProcessorVersionMetadata",
"ImportProcessorVersionRequest",
"ImportProcessorVersionResponse",
"ListDocumentsRequest",
"ListDocumentsResponse",
"ListEvaluationsRequest",
"ListEvaluationsResponse",
"ListProcessorTypesRequest",
Expand All @@ -192,6 +207,7 @@
"Processor",
"ProcessorType",
"ProcessorVersion",
"ProcessorVersionAlias",
"PropertyMetadata",
"RawDocument",
"ReviewDocumentOperationMetadata",
Expand All @@ -201,6 +217,7 @@
"SetDefaultProcessorVersionMetadata",
"SetDefaultProcessorVersionRequest",
"SetDefaultProcessorVersionResponse",
"SummaryOptions",
"TrainProcessorVersionMetadata",
"TrainProcessorVersionRequest",
"TrainProcessorVersionResponse",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,11 @@
"import_documents"
]
},
"ListDocuments": {
"methods": [
"list_documents"
]
},
"UpdateDataset": {
"methods": [
"update_dataset"
Expand Down Expand Up @@ -429,6 +434,11 @@
"import_documents"
]
},
"ListDocuments": {
"methods": [
"list_documents"
]
},
"UpdateDataset": {
"methods": [
"update_dataset"
Expand Down Expand Up @@ -464,6 +474,11 @@
"import_documents"
]
},
"ListDocuments": {
"methods": [
"list_documents"
]
},
"UpdateDataset": {
"methods": [
"update_dataset"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.19.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -2918,21 +2918,20 @@ async def sample_import_processor_version():
request (Optional[Union[google.cloud.documentai_v1beta3.types.ImportProcessorVersionRequest, dict]]):
The request object. The request message for the
[ImportProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion]
method. Requirements:
method.

- The Document AI `Service
Agent <https://cloud.google.com/iam/docs/service-agents>`__
of the destination project must have `Document AI
Editor
role <https://cloud.google.com/document-ai/docs/access-control/iam-roles>`__
on the source project.
The Document AI `Service
Agent <https://cloud.google.com/iam/docs/service-agents>`__
of the destination project must have `Document AI Editor
role <https://cloud.google.com/document-ai/docs/access-control/iam-roles>`__
on the source project.

The destination project is specified as part of the
[parent][google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.parent]
field. The source project is specified as part of the
[source][ImportProcessorVersionRequest.processor_version_source
[source][google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.processor_version_source]
or
ImportProcessorVersionRequest.external_processor_version_source]
[external_processor_version_source][google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.external_processor_version_source]
field.
parent (:class:`str`):
Required. The destination processor name to create the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3217,21 +3217,20 @@ def sample_import_processor_version():
request (Union[google.cloud.documentai_v1beta3.types.ImportProcessorVersionRequest, dict]):
The request object. The request message for the
[ImportProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion]
method. Requirements:
method.

- The Document AI `Service
Agent <https://cloud.google.com/iam/docs/service-agents>`__
of the destination project must have `Document AI
Editor
role <https://cloud.google.com/document-ai/docs/access-control/iam-roles>`__
on the source project.
The Document AI `Service
Agent <https://cloud.google.com/iam/docs/service-agents>`__
of the destination project must have `Document AI Editor
role <https://cloud.google.com/document-ai/docs/access-control/iam-roles>`__
on the source project.

The destination project is specified as part of the
[parent][google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.parent]
field. The source project is specified as part of the
[source][ImportProcessorVersionRequest.processor_version_source
[source][google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.processor_version_source]
or
ImportProcessorVersionRequest.external_processor_version_source]
[external_processor_version_source][google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.external_processor_version_source]
field.
parent (str):
Required. The destination processor name to create the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2414,21 +2414,20 @@ def __call__(
request (~.document_processor_service.ImportProcessorVersionRequest):
The request object. The request message for the
[ImportProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion]
method. Requirements:
method.

- The Document AI `Service
Agent <https://cloud.google.com/iam/docs/service-agents>`__
of the destination project must have `Document AI
Editor
role <https://cloud.google.com/document-ai/docs/access-control/iam-roles>`__
on the source project.
The Document AI `Service
Agent <https://cloud.google.com/iam/docs/service-agents>`__
of the destination project must have `Document AI Editor
role <https://cloud.google.com/document-ai/docs/access-control/iam-roles>`__
on the source project.

The destination project is specified as part of the
[parent][google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.parent]
field. The source project is specified as part of the
[source][ImportProcessorVersionRequest.processor_version_source
[source][google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.processor_version_source]
or
ImportProcessorVersionRequest.external_processor_version_source]
[external_processor_version_source][google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.external_processor_version_source]
field.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
Expand Down
Loading