tencentcloud-sdk-python-ocr 3.1.12__tar.gz → 3.1.13__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tencentcloud_sdk_python_ocr-3.1.12 → tencentcloud_sdk_python_ocr-3.1.13}/PKG-INFO +2 -2
- {tencentcloud_sdk_python_ocr-3.1.12 → tencentcloud_sdk_python_ocr-3.1.13}/setup.py +1 -1
- {tencentcloud_sdk_python_ocr-3.1.12 → tencentcloud_sdk_python_ocr-3.1.13}/tencentcloud/__init__.py +1 -1
- {tencentcloud_sdk_python_ocr-3.1.12 → tencentcloud_sdk_python_ocr-3.1.13}/tencentcloud/ocr/v20181119/errorcodes.py +3 -0
- {tencentcloud_sdk_python_ocr-3.1.12 → tencentcloud_sdk_python_ocr-3.1.13}/tencentcloud/ocr/v20181119/models.py +179 -0
- {tencentcloud_sdk_python_ocr-3.1.12 → tencentcloud_sdk_python_ocr-3.1.13}/tencentcloud/ocr/v20181119/ocr_client.py +23 -0
- {tencentcloud_sdk_python_ocr-3.1.12 → tencentcloud_sdk_python_ocr-3.1.13}/tencentcloud/ocr/v20181119/ocr_client_async.py +18 -0
- {tencentcloud_sdk_python_ocr-3.1.12 → tencentcloud_sdk_python_ocr-3.1.13}/tencentcloud_sdk_python_ocr.egg-info/PKG-INFO +2 -2
- tencentcloud_sdk_python_ocr-3.1.13/tencentcloud_sdk_python_ocr.egg-info/requires.txt +1 -0
- tencentcloud_sdk_python_ocr-3.1.12/tencentcloud_sdk_python_ocr.egg-info/requires.txt +0 -1
- {tencentcloud_sdk_python_ocr-3.1.12 → tencentcloud_sdk_python_ocr-3.1.13}/README.rst +0 -0
- {tencentcloud_sdk_python_ocr-3.1.12 → tencentcloud_sdk_python_ocr-3.1.13}/setup.cfg +0 -0
- {tencentcloud_sdk_python_ocr-3.1.12 → tencentcloud_sdk_python_ocr-3.1.13}/tencentcloud/ocr/__init__.py +0 -0
- {tencentcloud_sdk_python_ocr-3.1.12 → tencentcloud_sdk_python_ocr-3.1.13}/tencentcloud/ocr/v20181119/__init__.py +0 -0
- {tencentcloud_sdk_python_ocr-3.1.12 → tencentcloud_sdk_python_ocr-3.1.13}/tencentcloud_sdk_python_ocr.egg-info/SOURCES.txt +0 -0
- {tencentcloud_sdk_python_ocr-3.1.12 → tencentcloud_sdk_python_ocr-3.1.13}/tencentcloud_sdk_python_ocr.egg-info/dependency_links.txt +0 -0
- {tencentcloud_sdk_python_ocr-3.1.12 → tencentcloud_sdk_python_ocr-3.1.13}/tencentcloud_sdk_python_ocr.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tencentcloud-sdk-python-ocr
|
|
3
|
-
Version: 3.1.
|
|
3
|
+
Version: 3.1.13
|
|
4
4
|
Summary: Tencent Cloud Ocr SDK for Python
|
|
5
5
|
Home-page: https://github.com/TencentCloud/tencentcloud-sdk-python
|
|
6
6
|
Author: Tencent Cloud
|
|
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 2.7
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.6
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
-
Requires-Dist: tencentcloud-sdk-python-common<4.0.0,>=3.1.
|
|
18
|
+
Requires-Dist: tencentcloud-sdk-python-common<4.0.0,>=3.1.13
|
|
19
19
|
|
|
20
20
|
============================
|
|
21
21
|
Tencent Cloud SDK for Python
|
|
@@ -8,7 +8,7 @@ ROOT = os.path.dirname(__file__)
|
|
|
8
8
|
|
|
9
9
|
setup(
|
|
10
10
|
name='tencentcloud-sdk-python-ocr',
|
|
11
|
-
install_requires=["tencentcloud-sdk-python-common>=3.1.
|
|
11
|
+
install_requires=["tencentcloud-sdk-python-common>=3.1.13,<4.0.0"],
|
|
12
12
|
|
|
13
13
|
version=tencentcloud.__version__,
|
|
14
14
|
description='Tencent Cloud Ocr SDK for Python',
|
|
@@ -128,6 +128,9 @@ FAILEDOPERATION_OCRFAILED = 'FailedOperation.OcrFailed'
|
|
|
128
128
|
# PDF解析失败。
|
|
129
129
|
FAILEDOPERATION_PDFPARSEFAILED = 'FailedOperation.PDFParseFailed'
|
|
130
130
|
|
|
131
|
+
# 结果解析失败
|
|
132
|
+
FAILEDOPERATION_RESPONSEPARSEFAILED = 'FailedOperation.ResponseParseFailed'
|
|
133
|
+
|
|
131
134
|
# 未知错误。
|
|
132
135
|
FAILEDOPERATION_UNKNOWERROR = 'FailedOperation.UnKnowError'
|
|
133
136
|
|
|
@@ -8509,6 +8509,185 @@ class EstateCertOCRResponse(AbstractModel):
|
|
|
8509
8509
|
self._RequestId = params.get("RequestId")
|
|
8510
8510
|
|
|
8511
8511
|
|
|
8512
|
+
class ExtractDocAgentRequest(AbstractModel):
|
|
8513
|
+
r"""ExtractDocAgent请求参数结构体
|
|
8514
|
+
|
|
8515
|
+
"""
|
|
8516
|
+
|
|
8517
|
+
def __init__(self):
|
|
8518
|
+
r"""
|
|
8519
|
+
:param _ImageBase64: 图片/PDF的 Base64 值。 要求图片/PDF经Base64编码后不超过 10M,分辨率建议600*800以上,支持PNG、JPG、JPEG、BMP、PDF格式。 图片支持的像素范围:需介于20-10000px之间。 图片的 ImageUrl、ImageBase64 必须提供一个,如果都提供,只使用 ImageUrl。
|
|
8520
|
+
:type ImageBase64: str
|
|
8521
|
+
:param _ImageUrl: 图片/PDF的 Url 地址。 要求图片/PDF经Base64编码后不超过 10M,分辨率建议600*800以上,支持PNG、JPG、JPEG、BMP、PDF格式。 图片支持的像素范围:需介于20-10000px之间。 图片存储于腾讯云的 Url 可保障更高的下载速度和稳定性,建议图片存储于腾讯云。非腾讯云存储的 Url 速度和稳定性可能受一定影响。
|
|
8522
|
+
:type ImageUrl: str
|
|
8523
|
+
:param _ItemNames: 自定义抽取需要的字段名称、字段类型、字段提示词。
|
|
8524
|
+
:type ItemNames: list of ItemNames
|
|
8525
|
+
:param _PdfPageNumber: 需要识别的PDF页面的对应页码,仅支持PDF单页识别,当上传文件为PDF时有效。
|
|
8526
|
+
:type PdfPageNumber: int
|
|
8527
|
+
"""
|
|
8528
|
+
self._ImageBase64 = None
|
|
8529
|
+
self._ImageUrl = None
|
|
8530
|
+
self._ItemNames = None
|
|
8531
|
+
self._PdfPageNumber = None
|
|
8532
|
+
|
|
8533
|
+
@property
|
|
8534
|
+
def ImageBase64(self):
|
|
8535
|
+
r"""图片/PDF的 Base64 值。 要求图片/PDF经Base64编码后不超过 10M,分辨率建议600*800以上,支持PNG、JPG、JPEG、BMP、PDF格式。 图片支持的像素范围:需介于20-10000px之间。 图片的 ImageUrl、ImageBase64 必须提供一个,如果都提供,只使用 ImageUrl。
|
|
8536
|
+
:rtype: str
|
|
8537
|
+
"""
|
|
8538
|
+
return self._ImageBase64
|
|
8539
|
+
|
|
8540
|
+
@ImageBase64.setter
|
|
8541
|
+
def ImageBase64(self, ImageBase64):
|
|
8542
|
+
self._ImageBase64 = ImageBase64
|
|
8543
|
+
|
|
8544
|
+
@property
|
|
8545
|
+
def ImageUrl(self):
|
|
8546
|
+
r"""图片/PDF的 Url 地址。 要求图片/PDF经Base64编码后不超过 10M,分辨率建议600*800以上,支持PNG、JPG、JPEG、BMP、PDF格式。 图片支持的像素范围:需介于20-10000px之间。 图片存储于腾讯云的 Url 可保障更高的下载速度和稳定性,建议图片存储于腾讯云。非腾讯云存储的 Url 速度和稳定性可能受一定影响。
|
|
8547
|
+
:rtype: str
|
|
8548
|
+
"""
|
|
8549
|
+
return self._ImageUrl
|
|
8550
|
+
|
|
8551
|
+
@ImageUrl.setter
|
|
8552
|
+
def ImageUrl(self, ImageUrl):
|
|
8553
|
+
self._ImageUrl = ImageUrl
|
|
8554
|
+
|
|
8555
|
+
@property
|
|
8556
|
+
def ItemNames(self):
|
|
8557
|
+
r"""自定义抽取需要的字段名称、字段类型、字段提示词。
|
|
8558
|
+
:rtype: list of ItemNames
|
|
8559
|
+
"""
|
|
8560
|
+
return self._ItemNames
|
|
8561
|
+
|
|
8562
|
+
@ItemNames.setter
|
|
8563
|
+
def ItemNames(self, ItemNames):
|
|
8564
|
+
self._ItemNames = ItemNames
|
|
8565
|
+
|
|
8566
|
+
@property
|
|
8567
|
+
def PdfPageNumber(self):
|
|
8568
|
+
r"""需要识别的PDF页面的对应页码,仅支持PDF单页识别,当上传文件为PDF时有效。
|
|
8569
|
+
:rtype: int
|
|
8570
|
+
"""
|
|
8571
|
+
return self._PdfPageNumber
|
|
8572
|
+
|
|
8573
|
+
@PdfPageNumber.setter
|
|
8574
|
+
def PdfPageNumber(self, PdfPageNumber):
|
|
8575
|
+
self._PdfPageNumber = PdfPageNumber
|
|
8576
|
+
|
|
8577
|
+
|
|
8578
|
+
def _deserialize(self, params):
|
|
8579
|
+
self._ImageBase64 = params.get("ImageBase64")
|
|
8580
|
+
self._ImageUrl = params.get("ImageUrl")
|
|
8581
|
+
if params.get("ItemNames") is not None:
|
|
8582
|
+
self._ItemNames = []
|
|
8583
|
+
for item in params.get("ItemNames"):
|
|
8584
|
+
obj = ItemNames()
|
|
8585
|
+
obj._deserialize(item)
|
|
8586
|
+
self._ItemNames.append(obj)
|
|
8587
|
+
self._PdfPageNumber = params.get("PdfPageNumber")
|
|
8588
|
+
memeber_set = set(params.keys())
|
|
8589
|
+
for name, value in vars(self).items():
|
|
8590
|
+
property_name = name[1:]
|
|
8591
|
+
if property_name in memeber_set:
|
|
8592
|
+
memeber_set.remove(property_name)
|
|
8593
|
+
if len(memeber_set) > 0:
|
|
8594
|
+
warnings.warn("%s fileds are useless." % ",".join(memeber_set))
|
|
8595
|
+
|
|
8596
|
+
|
|
8597
|
+
|
|
8598
|
+
class ExtractDocAgentResponse(AbstractModel):
|
|
8599
|
+
r"""ExtractDocAgent返回参数结构体
|
|
8600
|
+
|
|
8601
|
+
"""
|
|
8602
|
+
|
|
8603
|
+
def __init__(self):
|
|
8604
|
+
r"""
|
|
8605
|
+
:param _Angle: 图片旋转角度(角度制),文本的水平方向为 0;顺时针为正,逆时针为负。
|
|
8606
|
+
:type Angle: float
|
|
8607
|
+
:param _StructuralList: 配置结构化文本信息。
|
|
8608
|
+
:type StructuralList: list of GroupInfo
|
|
8609
|
+
:param _ErrorCode: 任务执行错误码。当任务状态不为 FAIL 时,该值为""。
|
|
8610
|
+
:type ErrorCode: str
|
|
8611
|
+
:param _ErrorMessage: 任务执行错误信息。当任务状态不为 FAIL 时,该值为""。
|
|
8612
|
+
:type ErrorMessage: str
|
|
8613
|
+
:param _RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
|
|
8614
|
+
:type RequestId: str
|
|
8615
|
+
"""
|
|
8616
|
+
self._Angle = None
|
|
8617
|
+
self._StructuralList = None
|
|
8618
|
+
self._ErrorCode = None
|
|
8619
|
+
self._ErrorMessage = None
|
|
8620
|
+
self._RequestId = None
|
|
8621
|
+
|
|
8622
|
+
@property
|
|
8623
|
+
def Angle(self):
|
|
8624
|
+
r"""图片旋转角度(角度制),文本的水平方向为 0;顺时针为正,逆时针为负。
|
|
8625
|
+
:rtype: float
|
|
8626
|
+
"""
|
|
8627
|
+
return self._Angle
|
|
8628
|
+
|
|
8629
|
+
@Angle.setter
|
|
8630
|
+
def Angle(self, Angle):
|
|
8631
|
+
self._Angle = Angle
|
|
8632
|
+
|
|
8633
|
+
@property
|
|
8634
|
+
def StructuralList(self):
|
|
8635
|
+
r"""配置结构化文本信息。
|
|
8636
|
+
:rtype: list of GroupInfo
|
|
8637
|
+
"""
|
|
8638
|
+
return self._StructuralList
|
|
8639
|
+
|
|
8640
|
+
@StructuralList.setter
|
|
8641
|
+
def StructuralList(self, StructuralList):
|
|
8642
|
+
self._StructuralList = StructuralList
|
|
8643
|
+
|
|
8644
|
+
@property
|
|
8645
|
+
def ErrorCode(self):
|
|
8646
|
+
r"""任务执行错误码。当任务状态不为 FAIL 时,该值为""。
|
|
8647
|
+
:rtype: str
|
|
8648
|
+
"""
|
|
8649
|
+
return self._ErrorCode
|
|
8650
|
+
|
|
8651
|
+
@ErrorCode.setter
|
|
8652
|
+
def ErrorCode(self, ErrorCode):
|
|
8653
|
+
self._ErrorCode = ErrorCode
|
|
8654
|
+
|
|
8655
|
+
@property
|
|
8656
|
+
def ErrorMessage(self):
|
|
8657
|
+
r"""任务执行错误信息。当任务状态不为 FAIL 时,该值为""。
|
|
8658
|
+
:rtype: str
|
|
8659
|
+
"""
|
|
8660
|
+
return self._ErrorMessage
|
|
8661
|
+
|
|
8662
|
+
@ErrorMessage.setter
|
|
8663
|
+
def ErrorMessage(self, ErrorMessage):
|
|
8664
|
+
self._ErrorMessage = ErrorMessage
|
|
8665
|
+
|
|
8666
|
+
@property
|
|
8667
|
+
def RequestId(self):
|
|
8668
|
+
r"""唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
|
|
8669
|
+
:rtype: str
|
|
8670
|
+
"""
|
|
8671
|
+
return self._RequestId
|
|
8672
|
+
|
|
8673
|
+
@RequestId.setter
|
|
8674
|
+
def RequestId(self, RequestId):
|
|
8675
|
+
self._RequestId = RequestId
|
|
8676
|
+
|
|
8677
|
+
|
|
8678
|
+
def _deserialize(self, params):
|
|
8679
|
+
self._Angle = params.get("Angle")
|
|
8680
|
+
if params.get("StructuralList") is not None:
|
|
8681
|
+
self._StructuralList = []
|
|
8682
|
+
for item in params.get("StructuralList"):
|
|
8683
|
+
obj = GroupInfo()
|
|
8684
|
+
obj._deserialize(item)
|
|
8685
|
+
self._StructuralList.append(obj)
|
|
8686
|
+
self._ErrorCode = params.get("ErrorCode")
|
|
8687
|
+
self._ErrorMessage = params.get("ErrorMessage")
|
|
8688
|
+
self._RequestId = params.get("RequestId")
|
|
8689
|
+
|
|
8690
|
+
|
|
8512
8691
|
class ExtractDocBasicRequest(AbstractModel):
|
|
8513
8692
|
r"""ExtractDocBasic请求参数结构体
|
|
8514
8693
|
|
|
@@ -460,6 +460,29 @@ class OcrClient(AbstractClient):
|
|
|
460
460
|
raise TencentCloudSDKException(type(e).__name__, str(e))
|
|
461
461
|
|
|
462
462
|
|
|
463
|
+
def ExtractDocAgent(self, request):
|
|
464
|
+
r"""用于查询文档处理任务。文档处理领域里常见的通用Agent 如抽取、比对之类的,目前我们提供的抽取,但未来可以根据实际情况和客户需求扩展。
|
|
465
|
+
|
|
466
|
+
:param request: Request instance for ExtractDocAgent.
|
|
467
|
+
:type request: :class:`tencentcloud.ocr.v20181119.models.ExtractDocAgentRequest`
|
|
468
|
+
:rtype: :class:`tencentcloud.ocr.v20181119.models.ExtractDocAgentResponse`
|
|
469
|
+
|
|
470
|
+
"""
|
|
471
|
+
try:
|
|
472
|
+
params = request._serialize()
|
|
473
|
+
headers = request.headers
|
|
474
|
+
body = self.call("ExtractDocAgent", params, headers=headers)
|
|
475
|
+
response = json.loads(body)
|
|
476
|
+
model = models.ExtractDocAgentResponse()
|
|
477
|
+
model._deserialize(response["Response"])
|
|
478
|
+
return model
|
|
479
|
+
except Exception as e:
|
|
480
|
+
if isinstance(e, TencentCloudSDKException):
|
|
481
|
+
raise
|
|
482
|
+
else:
|
|
483
|
+
raise TencentCloudSDKException(type(e).__name__, str(e))
|
|
484
|
+
|
|
485
|
+
|
|
463
486
|
def ExtractDocBasic(self, request):
|
|
464
487
|
r"""本接口支持识别并提取制式卡证、票据、表单等结构化场景的字段信息。无需任何配置,灵活高效。适用于各类结构化信息录入场景。点击[立即体验](https://ocrdemo.cloud.tencent.com/?action=ExtractDocBasic)。
|
|
465
488
|
|
|
@@ -374,6 +374,24 @@ class OcrClient(AbstractClient):
|
|
|
374
374
|
|
|
375
375
|
return await self.call_and_deserialize(**kwargs)
|
|
376
376
|
|
|
377
|
+
async def ExtractDocAgent(
|
|
378
|
+
self,
|
|
379
|
+
request: models.ExtractDocAgentRequest,
|
|
380
|
+
opts: Dict = None,
|
|
381
|
+
) -> models.ExtractDocAgentResponse:
|
|
382
|
+
"""
|
|
383
|
+
用于查询文档处理任务。文档处理领域里常见的通用Agent 如抽取、比对之类的,目前我们提供的抽取,但未来可以根据实际情况和客户需求扩展。
|
|
384
|
+
"""
|
|
385
|
+
|
|
386
|
+
kwargs = {}
|
|
387
|
+
kwargs["action"] = "ExtractDocAgent"
|
|
388
|
+
kwargs["params"] = request._serialize()
|
|
389
|
+
kwargs["resp_cls"] = models.ExtractDocAgentResponse
|
|
390
|
+
kwargs["headers"] = request.headers
|
|
391
|
+
kwargs["opts"] = opts or {}
|
|
392
|
+
|
|
393
|
+
return await self.call_and_deserialize(**kwargs)
|
|
394
|
+
|
|
377
395
|
async def ExtractDocBasic(
|
|
378
396
|
self,
|
|
379
397
|
request: models.ExtractDocBasicRequest,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tencentcloud-sdk-python-ocr
|
|
3
|
-
Version: 3.1.
|
|
3
|
+
Version: 3.1.13
|
|
4
4
|
Summary: Tencent Cloud Ocr SDK for Python
|
|
5
5
|
Home-page: https://github.com/TencentCloud/tencentcloud-sdk-python
|
|
6
6
|
Author: Tencent Cloud
|
|
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 2.7
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.6
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
-
Requires-Dist: tencentcloud-sdk-python-common<4.0.0,>=3.1.
|
|
18
|
+
Requires-Dist: tencentcloud-sdk-python-common<4.0.0,>=3.1.13
|
|
19
19
|
|
|
20
20
|
============================
|
|
21
21
|
Tencent Cloud SDK for Python
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
tencentcloud-sdk-python-common<4.0.0,>=3.1.13
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
tencentcloud-sdk-python-common<4.0.0,>=3.1.12
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|