tencentcloud-sdk-python-tmt 3.0.1460__tar.gz → 3.1.50__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_tmt-3.1.50/PKG-INFO +46 -0
- {tencentcloud-sdk-python-tmt-3.0.1460 → tencentcloud_sdk_python_tmt-3.1.50}/setup.py +2 -1
- {tencentcloud-sdk-python-tmt-3.0.1460 → tencentcloud_sdk_python_tmt-3.1.50}/tencentcloud/__init__.py +1 -1
- {tencentcloud-sdk-python-tmt-3.0.1460 → tencentcloud_sdk_python_tmt-3.1.50}/tencentcloud/tmt/v20180321/errorcodes.py +3 -0
- {tencentcloud-sdk-python-tmt-3.0.1460 → tencentcloud_sdk_python_tmt-3.1.50}/tencentcloud/tmt/v20180321/models.py +159 -64
- tencentcloud_sdk_python_tmt-3.1.50/tencentcloud/tmt/v20180321/tmt_client_async.py +183 -0
- tencentcloud_sdk_python_tmt-3.1.50/tencentcloud_sdk_python_tmt.egg-info/PKG-INFO +46 -0
- {tencentcloud-sdk-python-tmt-3.0.1460 → tencentcloud_sdk_python_tmt-3.1.50}/tencentcloud_sdk_python_tmt.egg-info/SOURCES.txt +1 -0
- tencentcloud_sdk_python_tmt-3.1.50/tencentcloud_sdk_python_tmt.egg-info/requires.txt +1 -0
- tencentcloud-sdk-python-tmt-3.0.1460/PKG-INFO +0 -45
- tencentcloud-sdk-python-tmt-3.0.1460/tencentcloud_sdk_python_tmt.egg-info/PKG-INFO +0 -45
- tencentcloud-sdk-python-tmt-3.0.1460/tencentcloud_sdk_python_tmt.egg-info/requires.txt +0 -1
- {tencentcloud-sdk-python-tmt-3.0.1460 → tencentcloud_sdk_python_tmt-3.1.50}/README.rst +0 -0
- {tencentcloud-sdk-python-tmt-3.0.1460 → tencentcloud_sdk_python_tmt-3.1.50}/setup.cfg +0 -0
- {tencentcloud-sdk-python-tmt-3.0.1460 → tencentcloud_sdk_python_tmt-3.1.50}/tencentcloud/tmt/__init__.py +0 -0
- {tencentcloud-sdk-python-tmt-3.0.1460 → tencentcloud_sdk_python_tmt-3.1.50}/tencentcloud/tmt/v20180321/__init__.py +0 -0
- {tencentcloud-sdk-python-tmt-3.0.1460 → tencentcloud_sdk_python_tmt-3.1.50}/tencentcloud/tmt/v20180321/tmt_client.py +0 -0
- {tencentcloud-sdk-python-tmt-3.0.1460 → tencentcloud_sdk_python_tmt-3.1.50}/tencentcloud_sdk_python_tmt.egg-info/dependency_links.txt +0 -0
- {tencentcloud-sdk-python-tmt-3.0.1460 → tencentcloud_sdk_python_tmt-3.1.50}/tencentcloud_sdk_python_tmt.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: tencentcloud-sdk-python-tmt
|
|
3
|
+
Version: 3.1.50
|
|
4
|
+
Summary: Tencent Cloud Tmt SDK for Python
|
|
5
|
+
Home-page: https://github.com/TencentCloud/tencentcloud-sdk-python
|
|
6
|
+
Author: Tencent Cloud
|
|
7
|
+
Maintainer-email: tencentcloudapi@tencent.com
|
|
8
|
+
License: Apache License 2.0
|
|
9
|
+
Platform: any
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Programming Language :: Python
|
|
14
|
+
Classifier: Programming Language :: Python :: 2.7
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
+
Requires-Dist: tencentcloud-sdk-python-common<4.0.0,>=3.1.50
|
|
19
|
+
|
|
20
|
+
============================
|
|
21
|
+
Tencent Cloud SDK for Python
|
|
22
|
+
============================
|
|
23
|
+
|
|
24
|
+
Tencent Cloud Python Tmt SDK is the official software development kit, which allows Python developers to write software that makes use of Tencent Cloud services like CVM and CBS.
|
|
25
|
+
The SDK works on Python versions:
|
|
26
|
+
|
|
27
|
+
* 2.7 and greater, including 3.x
|
|
28
|
+
|
|
29
|
+
Quick Start
|
|
30
|
+
-----------
|
|
31
|
+
|
|
32
|
+
First, install the library:
|
|
33
|
+
|
|
34
|
+
.. code-block:: sh
|
|
35
|
+
|
|
36
|
+
$ pip install tencentcloud-sdk-python-common
|
|
37
|
+
$ pip install tencentcloud-sdk-python-tmt
|
|
38
|
+
|
|
39
|
+
or download source code from github and install:
|
|
40
|
+
|
|
41
|
+
.. code-block:: sh
|
|
42
|
+
|
|
43
|
+
$ git clone https://github.com/tencentcloud/tencentcloud-sdk-python.git
|
|
44
|
+
$ cd tencentcloud-sdk-python
|
|
45
|
+
$ python package.py --components common tmt
|
|
46
|
+
|
|
@@ -8,7 +8,8 @@ ROOT = os.path.dirname(__file__)
|
|
|
8
8
|
|
|
9
9
|
setup(
|
|
10
10
|
name='tencentcloud-sdk-python-tmt',
|
|
11
|
-
install_requires=["tencentcloud-sdk-python-common>=3.
|
|
11
|
+
install_requires=["tencentcloud-sdk-python-common>=3.1.50,<4.0.0"],
|
|
12
|
+
|
|
12
13
|
version=tencentcloud.__version__,
|
|
13
14
|
description='Tencent Cloud Tmt SDK for Python',
|
|
14
15
|
long_description=open('README.rst').read(),
|
|
@@ -99,6 +99,57 @@ class BoundingBox(AbstractModel):
|
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
|
|
102
|
+
class Coord(AbstractModel):
|
|
103
|
+
r"""坐标详细信息
|
|
104
|
+
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
def __init__(self):
|
|
108
|
+
r"""
|
|
109
|
+
:param _X: X坐标
|
|
110
|
+
:type X: int
|
|
111
|
+
:param _Y: Y坐标
|
|
112
|
+
:type Y: int
|
|
113
|
+
"""
|
|
114
|
+
self._X = None
|
|
115
|
+
self._Y = None
|
|
116
|
+
|
|
117
|
+
@property
|
|
118
|
+
def X(self):
|
|
119
|
+
r"""X坐标
|
|
120
|
+
:rtype: int
|
|
121
|
+
"""
|
|
122
|
+
return self._X
|
|
123
|
+
|
|
124
|
+
@X.setter
|
|
125
|
+
def X(self, X):
|
|
126
|
+
self._X = X
|
|
127
|
+
|
|
128
|
+
@property
|
|
129
|
+
def Y(self):
|
|
130
|
+
r"""Y坐标
|
|
131
|
+
:rtype: int
|
|
132
|
+
"""
|
|
133
|
+
return self._Y
|
|
134
|
+
|
|
135
|
+
@Y.setter
|
|
136
|
+
def Y(self, Y):
|
|
137
|
+
self._Y = Y
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def _deserialize(self, params):
|
|
141
|
+
self._X = params.get("X")
|
|
142
|
+
self._Y = params.get("Y")
|
|
143
|
+
memeber_set = set(params.keys())
|
|
144
|
+
for name, value in vars(self).items():
|
|
145
|
+
property_name = name[1:]
|
|
146
|
+
if property_name in memeber_set:
|
|
147
|
+
memeber_set.remove(property_name)
|
|
148
|
+
if len(memeber_set) > 0:
|
|
149
|
+
warnings.warn("%s fileds are useless." % ",".join(memeber_set))
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
102
153
|
class FileTranslateRequest(AbstractModel):
|
|
103
154
|
r"""FileTranslate请求参数结构体
|
|
104
155
|
|
|
@@ -607,32 +658,11 @@ class ImageTranslateLLMRequest(AbstractModel):
|
|
|
607
658
|
|
|
608
659
|
def __init__(self):
|
|
609
660
|
r"""
|
|
610
|
-
:param _Data:
|
|
661
|
+
:param _Data: <p>图片数据的Base64字符串,经Base64编码后不超过 9M,分辨率建议600*800以上,支持PNG、JPG、JPEG格式。</p>
|
|
611
662
|
:type Data: str
|
|
612
|
-
:param _Target:
|
|
613
|
-
|
|
614
|
-
- 中文:zh
|
|
615
|
-
- 繁体(中国台湾):zh-TW
|
|
616
|
-
- 繁体(中国香港):zh-HK
|
|
617
|
-
- 英文:en
|
|
618
|
-
- 日语:ja
|
|
619
|
-
- 韩语:ko
|
|
620
|
-
- 泰语:th
|
|
621
|
-
- 越南语:vi
|
|
622
|
-
- 俄语:ru
|
|
623
|
-
- 德语:de
|
|
624
|
-
- 法语:fr
|
|
625
|
-
- 阿拉伯语:ar
|
|
626
|
-
- 西班牙语:es
|
|
627
|
-
- 意大利语:it
|
|
628
|
-
- 印度尼西亚语:id
|
|
629
|
-
- 马来西亚语:ms
|
|
630
|
-
- 葡萄牙语:pt
|
|
631
|
-
- 土耳其语:tr
|
|
632
|
-
-
|
|
663
|
+
:param _Target: <p>目标语言,支持语言列表:</p><ul><li>中文:zh</li><li>繁体(中国台湾):zh-TW</li><li>繁体(中国香港):zh-HK</li><li>英文:en</li><li>日语:ja</li><li>韩语:ko</li><li>泰语:th</li><li>越南语:vi</li><li>俄语:ru</li><li>德语:de</li><li>法语:fr</li><li>阿拉伯语:ar</li><li>西班牙语:es</li><li>意大利语:it</li><li>印度尼西亚语:id</li><li>马来西亚语:ms</li><li>葡萄牙语:pt</li><li>土耳其语:tr<br>-</li></ul>
|
|
633
664
|
:type Target: str
|
|
634
|
-
:param _Url:
|
|
635
|
-
|
|
665
|
+
:param _Url: <p>输入图 Url。 使用Url的时候,Data参数需要传入""。 图片限制:小于 10MB,分辨率建议600*800以上,格式支持 jpg、jpeg、png。</p>
|
|
636
666
|
:type Url: str
|
|
637
667
|
"""
|
|
638
668
|
self._Data = None
|
|
@@ -641,7 +671,7 @@ class ImageTranslateLLMRequest(AbstractModel):
|
|
|
641
671
|
|
|
642
672
|
@property
|
|
643
673
|
def Data(self):
|
|
644
|
-
r"""
|
|
674
|
+
r"""<p>图片数据的Base64字符串,经Base64编码后不超过 9M,分辨率建议600*800以上,支持PNG、JPG、JPEG格式。</p>
|
|
645
675
|
:rtype: str
|
|
646
676
|
"""
|
|
647
677
|
return self._Data
|
|
@@ -652,27 +682,7 @@ class ImageTranslateLLMRequest(AbstractModel):
|
|
|
652
682
|
|
|
653
683
|
@property
|
|
654
684
|
def Target(self):
|
|
655
|
-
r"""
|
|
656
|
-
|
|
657
|
-
- 中文:zh
|
|
658
|
-
- 繁体(中国台湾):zh-TW
|
|
659
|
-
- 繁体(中国香港):zh-HK
|
|
660
|
-
- 英文:en
|
|
661
|
-
- 日语:ja
|
|
662
|
-
- 韩语:ko
|
|
663
|
-
- 泰语:th
|
|
664
|
-
- 越南语:vi
|
|
665
|
-
- 俄语:ru
|
|
666
|
-
- 德语:de
|
|
667
|
-
- 法语:fr
|
|
668
|
-
- 阿拉伯语:ar
|
|
669
|
-
- 西班牙语:es
|
|
670
|
-
- 意大利语:it
|
|
671
|
-
- 印度尼西亚语:id
|
|
672
|
-
- 马来西亚语:ms
|
|
673
|
-
- 葡萄牙语:pt
|
|
674
|
-
- 土耳其语:tr
|
|
675
|
-
-
|
|
685
|
+
r"""<p>目标语言,支持语言列表:</p><ul><li>中文:zh</li><li>繁体(中国台湾):zh-TW</li><li>繁体(中国香港):zh-HK</li><li>英文:en</li><li>日语:ja</li><li>韩语:ko</li><li>泰语:th</li><li>越南语:vi</li><li>俄语:ru</li><li>德语:de</li><li>法语:fr</li><li>阿拉伯语:ar</li><li>西班牙语:es</li><li>意大利语:it</li><li>印度尼西亚语:id</li><li>马来西亚语:ms</li><li>葡萄牙语:pt</li><li>土耳其语:tr<br>-</li></ul>
|
|
676
686
|
:rtype: str
|
|
677
687
|
"""
|
|
678
688
|
return self._Target
|
|
@@ -683,8 +693,7 @@ class ImageTranslateLLMRequest(AbstractModel):
|
|
|
683
693
|
|
|
684
694
|
@property
|
|
685
695
|
def Url(self):
|
|
686
|
-
r"""
|
|
687
|
-
|
|
696
|
+
r"""<p>输入图 Url。 使用Url的时候,Data参数需要传入""。 图片限制:小于 10MB,分辨率建议600*800以上,格式支持 jpg、jpeg、png。</p>
|
|
688
697
|
:rtype: str
|
|
689
698
|
"""
|
|
690
699
|
return self._Url
|
|
@@ -715,20 +724,19 @@ class ImageTranslateLLMResponse(AbstractModel):
|
|
|
715
724
|
|
|
716
725
|
def __init__(self):
|
|
717
726
|
r"""
|
|
718
|
-
:param _Data:
|
|
719
|
-
|
|
727
|
+
:param _Data: <p>图片数据的Base64字符串,输出格式为JPG。</p>
|
|
720
728
|
:type Data: str
|
|
721
|
-
:param _Source:
|
|
729
|
+
:param _Source: <p>原文本主要源语言。</p>
|
|
722
730
|
:type Source: str
|
|
723
|
-
:param _Target:
|
|
731
|
+
:param _Target: <p>目标翻译语言。</p>
|
|
724
732
|
:type Target: str
|
|
725
|
-
:param _SourceText:
|
|
733
|
+
:param _SourceText: <p>图片中的全部原文本。</p>
|
|
726
734
|
:type SourceText: str
|
|
727
|
-
:param _TargetText:
|
|
735
|
+
:param _TargetText: <p>图片中全部译文。</p>
|
|
728
736
|
:type TargetText: str
|
|
729
|
-
:param _Angle:
|
|
737
|
+
:param _Angle: <p>逆时针图片角度,取值范围为0-359</p>
|
|
730
738
|
:type Angle: float
|
|
731
|
-
:param _TransDetails:
|
|
739
|
+
:param _TransDetails: <p>翻译详情信息</p>
|
|
732
740
|
:type TransDetails: list of TransDetail
|
|
733
741
|
:param _RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
|
|
734
742
|
:type RequestId: str
|
|
@@ -744,8 +752,7 @@ class ImageTranslateLLMResponse(AbstractModel):
|
|
|
744
752
|
|
|
745
753
|
@property
|
|
746
754
|
def Data(self):
|
|
747
|
-
r"""
|
|
748
|
-
|
|
755
|
+
r"""<p>图片数据的Base64字符串,输出格式为JPG。</p>
|
|
749
756
|
:rtype: str
|
|
750
757
|
"""
|
|
751
758
|
return self._Data
|
|
@@ -756,7 +763,7 @@ class ImageTranslateLLMResponse(AbstractModel):
|
|
|
756
763
|
|
|
757
764
|
@property
|
|
758
765
|
def Source(self):
|
|
759
|
-
r"""
|
|
766
|
+
r"""<p>原文本主要源语言。</p>
|
|
760
767
|
:rtype: str
|
|
761
768
|
"""
|
|
762
769
|
return self._Source
|
|
@@ -767,7 +774,7 @@ class ImageTranslateLLMResponse(AbstractModel):
|
|
|
767
774
|
|
|
768
775
|
@property
|
|
769
776
|
def Target(self):
|
|
770
|
-
r"""
|
|
777
|
+
r"""<p>目标翻译语言。</p>
|
|
771
778
|
:rtype: str
|
|
772
779
|
"""
|
|
773
780
|
return self._Target
|
|
@@ -778,7 +785,7 @@ class ImageTranslateLLMResponse(AbstractModel):
|
|
|
778
785
|
|
|
779
786
|
@property
|
|
780
787
|
def SourceText(self):
|
|
781
|
-
r"""
|
|
788
|
+
r"""<p>图片中的全部原文本。</p>
|
|
782
789
|
:rtype: str
|
|
783
790
|
"""
|
|
784
791
|
return self._SourceText
|
|
@@ -789,7 +796,7 @@ class ImageTranslateLLMResponse(AbstractModel):
|
|
|
789
796
|
|
|
790
797
|
@property
|
|
791
798
|
def TargetText(self):
|
|
792
|
-
r"""
|
|
799
|
+
r"""<p>图片中全部译文。</p>
|
|
793
800
|
:rtype: str
|
|
794
801
|
"""
|
|
795
802
|
return self._TargetText
|
|
@@ -800,7 +807,7 @@ class ImageTranslateLLMResponse(AbstractModel):
|
|
|
800
807
|
|
|
801
808
|
@property
|
|
802
809
|
def Angle(self):
|
|
803
|
-
r"""
|
|
810
|
+
r"""<p>逆时针图片角度,取值范围为0-359</p>
|
|
804
811
|
:rtype: float
|
|
805
812
|
"""
|
|
806
813
|
return self._Angle
|
|
@@ -811,7 +818,7 @@ class ImageTranslateLLMResponse(AbstractModel):
|
|
|
811
818
|
|
|
812
819
|
@property
|
|
813
820
|
def TransDetails(self):
|
|
814
|
-
r"""
|
|
821
|
+
r"""<p>翻译详情信息</p>
|
|
815
822
|
:rtype: list of TransDetail
|
|
816
823
|
"""
|
|
817
824
|
return self._TransDetails
|
|
@@ -1284,6 +1291,77 @@ class LanguageDetectResponse(AbstractModel):
|
|
|
1284
1291
|
self._RequestId = params.get("RequestId")
|
|
1285
1292
|
|
|
1286
1293
|
|
|
1294
|
+
class RotateParagraphRect(AbstractModel):
|
|
1295
|
+
r"""段落文本旋转信息
|
|
1296
|
+
|
|
1297
|
+
"""
|
|
1298
|
+
|
|
1299
|
+
def __init__(self):
|
|
1300
|
+
r"""
|
|
1301
|
+
:param _Coord: 段落文本坐标
|
|
1302
|
+
:type Coord: list of Coord
|
|
1303
|
+
:param _TiltAngle: 旋转角度
|
|
1304
|
+
:type TiltAngle: float
|
|
1305
|
+
:param _Valid: 段落文本信息是否有效
|
|
1306
|
+
:type Valid: bool
|
|
1307
|
+
"""
|
|
1308
|
+
self._Coord = None
|
|
1309
|
+
self._TiltAngle = None
|
|
1310
|
+
self._Valid = None
|
|
1311
|
+
|
|
1312
|
+
@property
|
|
1313
|
+
def Coord(self):
|
|
1314
|
+
r"""段落文本坐标
|
|
1315
|
+
:rtype: list of Coord
|
|
1316
|
+
"""
|
|
1317
|
+
return self._Coord
|
|
1318
|
+
|
|
1319
|
+
@Coord.setter
|
|
1320
|
+
def Coord(self, Coord):
|
|
1321
|
+
self._Coord = Coord
|
|
1322
|
+
|
|
1323
|
+
@property
|
|
1324
|
+
def TiltAngle(self):
|
|
1325
|
+
r"""旋转角度
|
|
1326
|
+
:rtype: float
|
|
1327
|
+
"""
|
|
1328
|
+
return self._TiltAngle
|
|
1329
|
+
|
|
1330
|
+
@TiltAngle.setter
|
|
1331
|
+
def TiltAngle(self, TiltAngle):
|
|
1332
|
+
self._TiltAngle = TiltAngle
|
|
1333
|
+
|
|
1334
|
+
@property
|
|
1335
|
+
def Valid(self):
|
|
1336
|
+
r"""段落文本信息是否有效
|
|
1337
|
+
:rtype: bool
|
|
1338
|
+
"""
|
|
1339
|
+
return self._Valid
|
|
1340
|
+
|
|
1341
|
+
@Valid.setter
|
|
1342
|
+
def Valid(self, Valid):
|
|
1343
|
+
self._Valid = Valid
|
|
1344
|
+
|
|
1345
|
+
|
|
1346
|
+
def _deserialize(self, params):
|
|
1347
|
+
if params.get("Coord") is not None:
|
|
1348
|
+
self._Coord = []
|
|
1349
|
+
for item in params.get("Coord"):
|
|
1350
|
+
obj = Coord()
|
|
1351
|
+
obj._deserialize(item)
|
|
1352
|
+
self._Coord.append(obj)
|
|
1353
|
+
self._TiltAngle = params.get("TiltAngle")
|
|
1354
|
+
self._Valid = params.get("Valid")
|
|
1355
|
+
memeber_set = set(params.keys())
|
|
1356
|
+
for name, value in vars(self).items():
|
|
1357
|
+
property_name = name[1:]
|
|
1358
|
+
if property_name in memeber_set:
|
|
1359
|
+
memeber_set.remove(property_name)
|
|
1360
|
+
if len(memeber_set) > 0:
|
|
1361
|
+
warnings.warn("%s fileds are useless." % ",".join(memeber_set))
|
|
1362
|
+
|
|
1363
|
+
|
|
1364
|
+
|
|
1287
1365
|
class SpeechTranslateRequest(AbstractModel):
|
|
1288
1366
|
r"""SpeechTranslate请求参数结构体
|
|
1289
1367
|
|
|
@@ -2231,6 +2309,8 @@ class TransDetail(AbstractModel):
|
|
|
2231
2309
|
:type LineHeight: int
|
|
2232
2310
|
:param _SpamCode: 正常段落spam_code字段为0;如果存在spam_code字段且值大于0(1: 命中垃圾检查;2: 命中安全策略;3: 其他。),则命中安全检查被过滤。
|
|
2233
2311
|
:type SpamCode: int
|
|
2312
|
+
:param _RotateParagraphRect: 段落文本旋转信息,只在valid为true时表示坐标有效
|
|
2313
|
+
:type RotateParagraphRect: :class:`tencentcloud.tmt.v20180321.models.RotateParagraphRect`
|
|
2234
2314
|
"""
|
|
2235
2315
|
self._SourceLineText = None
|
|
2236
2316
|
self._TargetLineText = None
|
|
@@ -2238,6 +2318,7 @@ class TransDetail(AbstractModel):
|
|
|
2238
2318
|
self._LinesCount = None
|
|
2239
2319
|
self._LineHeight = None
|
|
2240
2320
|
self._SpamCode = None
|
|
2321
|
+
self._RotateParagraphRect = None
|
|
2241
2322
|
|
|
2242
2323
|
@property
|
|
2243
2324
|
def SourceLineText(self):
|
|
@@ -2305,6 +2386,17 @@ class TransDetail(AbstractModel):
|
|
|
2305
2386
|
def SpamCode(self, SpamCode):
|
|
2306
2387
|
self._SpamCode = SpamCode
|
|
2307
2388
|
|
|
2389
|
+
@property
|
|
2390
|
+
def RotateParagraphRect(self):
|
|
2391
|
+
r"""段落文本旋转信息,只在valid为true时表示坐标有效
|
|
2392
|
+
:rtype: :class:`tencentcloud.tmt.v20180321.models.RotateParagraphRect`
|
|
2393
|
+
"""
|
|
2394
|
+
return self._RotateParagraphRect
|
|
2395
|
+
|
|
2396
|
+
@RotateParagraphRect.setter
|
|
2397
|
+
def RotateParagraphRect(self, RotateParagraphRect):
|
|
2398
|
+
self._RotateParagraphRect = RotateParagraphRect
|
|
2399
|
+
|
|
2308
2400
|
|
|
2309
2401
|
def _deserialize(self, params):
|
|
2310
2402
|
self._SourceLineText = params.get("SourceLineText")
|
|
@@ -2315,6 +2407,9 @@ class TransDetail(AbstractModel):
|
|
|
2315
2407
|
self._LinesCount = params.get("LinesCount")
|
|
2316
2408
|
self._LineHeight = params.get("LineHeight")
|
|
2317
2409
|
self._SpamCode = params.get("SpamCode")
|
|
2410
|
+
if params.get("RotateParagraphRect") is not None:
|
|
2411
|
+
self._RotateParagraphRect = RotateParagraphRect()
|
|
2412
|
+
self._RotateParagraphRect._deserialize(params.get("RotateParagraphRect"))
|
|
2318
2413
|
memeber_set = set(params.keys())
|
|
2319
2414
|
for name, value in vars(self).items():
|
|
2320
2415
|
property_name = name[1:]
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# -*- coding: utf8 -*-
|
|
2
|
+
# Copyright (c) 2017-2025 Tencent. All Rights Reserved.
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
from tencentcloud.common.abstract_client_async import AbstractClient
|
|
19
|
+
from tencentcloud.tmt.v20180321 import models
|
|
20
|
+
from typing import Dict
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class TmtClient(AbstractClient):
|
|
24
|
+
_apiVersion = '2018-03-21'
|
|
25
|
+
_endpoint = 'tmt.tencentcloudapi.com'
|
|
26
|
+
_service = 'tmt'
|
|
27
|
+
|
|
28
|
+
async def FileTranslate(
|
|
29
|
+
self,
|
|
30
|
+
request: models.FileTranslateRequest,
|
|
31
|
+
opts: Dict = None,
|
|
32
|
+
) -> models.FileTranslateResponse:
|
|
33
|
+
"""
|
|
34
|
+
提交文档原文内容,输出任务ID, 支持原文为单一语种文档(如出现多语言文档,仅支持以选定的源语言相关内容翻译),文件格式有pdf、docx、pptx、xlsx,支持的文本格式有txt、xml、html、markdown、properties。任务翻译数据可保存7天,7天后不再返回任务数据。请注意保存。
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
kwargs = {}
|
|
38
|
+
kwargs["action"] = "FileTranslate"
|
|
39
|
+
kwargs["params"] = request._serialize()
|
|
40
|
+
kwargs["resp_cls"] = models.FileTranslateResponse
|
|
41
|
+
kwargs["headers"] = request.headers
|
|
42
|
+
kwargs["opts"] = opts or {}
|
|
43
|
+
|
|
44
|
+
return await self.call_and_deserialize(**kwargs)
|
|
45
|
+
|
|
46
|
+
async def GetFileTranslate(
|
|
47
|
+
self,
|
|
48
|
+
request: models.GetFileTranslateRequest,
|
|
49
|
+
opts: Dict = None,
|
|
50
|
+
) -> models.GetFileTranslateResponse:
|
|
51
|
+
"""
|
|
52
|
+
在调用文档翻译请求接口后,有回调和轮询两种方式获取识别结果。
|
|
53
|
+
•当采用回调方式时,翻译完成后会将结果通过 POST 请求的形式通知到用户在请求时填写的回调 URL,具体请参见[文件翻译回调说明](https://cloud.tencent.com/document/product/551/91138)。
|
|
54
|
+
• 当采用轮询方式时,需要主动提交任务ID来轮询识别结果,共有任务成功、等待、执行中和失败四种结果,具体信息请参见参数说明。
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
kwargs = {}
|
|
58
|
+
kwargs["action"] = "GetFileTranslate"
|
|
59
|
+
kwargs["params"] = request._serialize()
|
|
60
|
+
kwargs["resp_cls"] = models.GetFileTranslateResponse
|
|
61
|
+
kwargs["headers"] = request.headers
|
|
62
|
+
kwargs["opts"] = opts or {}
|
|
63
|
+
|
|
64
|
+
return await self.call_and_deserialize(**kwargs)
|
|
65
|
+
|
|
66
|
+
async def ImageTranslate(
|
|
67
|
+
self,
|
|
68
|
+
request: models.ImageTranslateRequest,
|
|
69
|
+
opts: Dict = None,
|
|
70
|
+
) -> models.ImageTranslateResponse:
|
|
71
|
+
"""
|
|
72
|
+
提供13种语言的图片翻译服务,可自动识别图片中的文本内容并翻译成目标语言,识别后的文本按行翻译,后续会提供可按段落翻译的版本。<br />
|
|
73
|
+
提示:对于一般开发者,我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
kwargs = {}
|
|
77
|
+
kwargs["action"] = "ImageTranslate"
|
|
78
|
+
kwargs["params"] = request._serialize()
|
|
79
|
+
kwargs["resp_cls"] = models.ImageTranslateResponse
|
|
80
|
+
kwargs["headers"] = request.headers
|
|
81
|
+
kwargs["opts"] = opts or {}
|
|
82
|
+
|
|
83
|
+
return await self.call_and_deserialize(**kwargs)
|
|
84
|
+
|
|
85
|
+
async def ImageTranslateLLM(
|
|
86
|
+
self,
|
|
87
|
+
request: models.ImageTranslateLLMRequest,
|
|
88
|
+
opts: Dict = None,
|
|
89
|
+
) -> models.ImageTranslateLLMResponse:
|
|
90
|
+
"""
|
|
91
|
+
提供18种语言的图片翻译服务,可自动识别图片中的文本内容并翻译成目标语言,识别后的文本按行翻译,后续会提供可按段落翻译的版本。
|
|
92
|
+
|
|
93
|
+
- 输入图片格式:png、jpg、jpeg等常用图片格式,不支持gif动图。
|
|
94
|
+
- 输出图片格式:jpg。
|
|
95
|
+
|
|
96
|
+
提示:对于一般开发者,我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
|
|
97
|
+
"""
|
|
98
|
+
|
|
99
|
+
kwargs = {}
|
|
100
|
+
kwargs["action"] = "ImageTranslateLLM"
|
|
101
|
+
kwargs["params"] = request._serialize()
|
|
102
|
+
kwargs["resp_cls"] = models.ImageTranslateLLMResponse
|
|
103
|
+
kwargs["headers"] = request.headers
|
|
104
|
+
kwargs["opts"] = opts or {}
|
|
105
|
+
|
|
106
|
+
return await self.call_and_deserialize(**kwargs)
|
|
107
|
+
|
|
108
|
+
async def LanguageDetect(
|
|
109
|
+
self,
|
|
110
|
+
request: models.LanguageDetectRequest,
|
|
111
|
+
opts: Dict = None,
|
|
112
|
+
) -> models.LanguageDetectResponse:
|
|
113
|
+
"""
|
|
114
|
+
可自动识别文本内容的语言种类,轻量高效,无需额外实现判断方式,使面向客户的服务体验更佳。 <br />
|
|
115
|
+
提示:对于一般开发者,我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
kwargs = {}
|
|
119
|
+
kwargs["action"] = "LanguageDetect"
|
|
120
|
+
kwargs["params"] = request._serialize()
|
|
121
|
+
kwargs["resp_cls"] = models.LanguageDetectResponse
|
|
122
|
+
kwargs["headers"] = request.headers
|
|
123
|
+
kwargs["opts"] = opts or {}
|
|
124
|
+
|
|
125
|
+
return await self.call_and_deserialize(**kwargs)
|
|
126
|
+
|
|
127
|
+
async def SpeechTranslate(
|
|
128
|
+
self,
|
|
129
|
+
request: models.SpeechTranslateRequest,
|
|
130
|
+
opts: Dict = None,
|
|
131
|
+
) -> models.SpeechTranslateResponse:
|
|
132
|
+
"""
|
|
133
|
+
本接口提供上传音频,将音频进行语音识别并翻译成文本的服务,目前开放中英互译的语音翻译服务。
|
|
134
|
+
待识别和翻译的音频文件可以是 pcm、mp3和speex 格式,其中支持流式传输的只有pcm格式,pcm采样率要求16kHz、位深16bit、单声道,音频内语音清晰。<br/>
|
|
135
|
+
如果采用流式传输的方式,要求每个分片时长200ms~500ms;如果采用非流式的传输方式,要求音频时长不超过8s。注意最后一个分片的IsEnd参数设置为1。<br />
|
|
136
|
+
提示:对于一般开发者,我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源部分。
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
kwargs = {}
|
|
140
|
+
kwargs["action"] = "SpeechTranslate"
|
|
141
|
+
kwargs["params"] = request._serialize()
|
|
142
|
+
kwargs["resp_cls"] = models.SpeechTranslateResponse
|
|
143
|
+
kwargs["headers"] = request.headers
|
|
144
|
+
kwargs["opts"] = opts or {}
|
|
145
|
+
|
|
146
|
+
return await self.call_and_deserialize(**kwargs)
|
|
147
|
+
|
|
148
|
+
async def TextTranslate(
|
|
149
|
+
self,
|
|
150
|
+
request: models.TextTranslateRequest,
|
|
151
|
+
opts: Dict = None,
|
|
152
|
+
) -> models.TextTranslateResponse:
|
|
153
|
+
"""
|
|
154
|
+
腾讯翻译为合作伙伴提供文本翻译、文档翻译、交互翻译、AI同传等多种机器翻译服务,具有toB多行业解决方案。作为WMT世界机器翻译大赛冠军,翻译准确度值得信赖,其中,交互翻译能力是业界领先技术;腾讯同传是AI同传业界标杆。<br />
|
|
155
|
+
提示:对于一般开发者,我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
|
|
156
|
+
"""
|
|
157
|
+
|
|
158
|
+
kwargs = {}
|
|
159
|
+
kwargs["action"] = "TextTranslate"
|
|
160
|
+
kwargs["params"] = request._serialize()
|
|
161
|
+
kwargs["resp_cls"] = models.TextTranslateResponse
|
|
162
|
+
kwargs["headers"] = request.headers
|
|
163
|
+
kwargs["opts"] = opts or {}
|
|
164
|
+
|
|
165
|
+
return await self.call_and_deserialize(**kwargs)
|
|
166
|
+
|
|
167
|
+
async def TextTranslateBatch(
|
|
168
|
+
self,
|
|
169
|
+
request: models.TextTranslateBatchRequest,
|
|
170
|
+
opts: Dict = None,
|
|
171
|
+
) -> models.TextTranslateBatchResponse:
|
|
172
|
+
"""
|
|
173
|
+
批量翻译文本的接口
|
|
174
|
+
"""
|
|
175
|
+
|
|
176
|
+
kwargs = {}
|
|
177
|
+
kwargs["action"] = "TextTranslateBatch"
|
|
178
|
+
kwargs["params"] = request._serialize()
|
|
179
|
+
kwargs["resp_cls"] = models.TextTranslateBatchResponse
|
|
180
|
+
kwargs["headers"] = request.headers
|
|
181
|
+
kwargs["opts"] = opts or {}
|
|
182
|
+
|
|
183
|
+
return await self.call_and_deserialize(**kwargs)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: tencentcloud-sdk-python-tmt
|
|
3
|
+
Version: 3.1.50
|
|
4
|
+
Summary: Tencent Cloud Tmt SDK for Python
|
|
5
|
+
Home-page: https://github.com/TencentCloud/tencentcloud-sdk-python
|
|
6
|
+
Author: Tencent Cloud
|
|
7
|
+
Maintainer-email: tencentcloudapi@tencent.com
|
|
8
|
+
License: Apache License 2.0
|
|
9
|
+
Platform: any
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Programming Language :: Python
|
|
14
|
+
Classifier: Programming Language :: Python :: 2.7
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
+
Requires-Dist: tencentcloud-sdk-python-common<4.0.0,>=3.1.50
|
|
19
|
+
|
|
20
|
+
============================
|
|
21
|
+
Tencent Cloud SDK for Python
|
|
22
|
+
============================
|
|
23
|
+
|
|
24
|
+
Tencent Cloud Python Tmt SDK is the official software development kit, which allows Python developers to write software that makes use of Tencent Cloud services like CVM and CBS.
|
|
25
|
+
The SDK works on Python versions:
|
|
26
|
+
|
|
27
|
+
* 2.7 and greater, including 3.x
|
|
28
|
+
|
|
29
|
+
Quick Start
|
|
30
|
+
-----------
|
|
31
|
+
|
|
32
|
+
First, install the library:
|
|
33
|
+
|
|
34
|
+
.. code-block:: sh
|
|
35
|
+
|
|
36
|
+
$ pip install tencentcloud-sdk-python-common
|
|
37
|
+
$ pip install tencentcloud-sdk-python-tmt
|
|
38
|
+
|
|
39
|
+
or download source code from github and install:
|
|
40
|
+
|
|
41
|
+
.. code-block:: sh
|
|
42
|
+
|
|
43
|
+
$ git clone https://github.com/tencentcloud/tencentcloud-sdk-python.git
|
|
44
|
+
$ cd tencentcloud-sdk-python
|
|
45
|
+
$ python package.py --components common tmt
|
|
46
|
+
|
|
@@ -7,6 +7,7 @@ tencentcloud/tmt/v20180321/__init__.py
|
|
|
7
7
|
tencentcloud/tmt/v20180321/errorcodes.py
|
|
8
8
|
tencentcloud/tmt/v20180321/models.py
|
|
9
9
|
tencentcloud/tmt/v20180321/tmt_client.py
|
|
10
|
+
tencentcloud/tmt/v20180321/tmt_client_async.py
|
|
10
11
|
tencentcloud_sdk_python_tmt.egg-info/PKG-INFO
|
|
11
12
|
tencentcloud_sdk_python_tmt.egg-info/SOURCES.txt
|
|
12
13
|
tencentcloud_sdk_python_tmt.egg-info/dependency_links.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
tencentcloud-sdk-python-common<4.0.0,>=3.1.50
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 1.2
|
|
2
|
-
Name: tencentcloud-sdk-python-tmt
|
|
3
|
-
Version: 3.0.1460
|
|
4
|
-
Summary: Tencent Cloud Tmt SDK for Python
|
|
5
|
-
Home-page: https://github.com/TencentCloud/tencentcloud-sdk-python
|
|
6
|
-
Author: Tencent Cloud
|
|
7
|
-
Maintainer-email: tencentcloudapi@tencent.com
|
|
8
|
-
License: Apache License 2.0
|
|
9
|
-
Description: ============================
|
|
10
|
-
Tencent Cloud SDK for Python
|
|
11
|
-
============================
|
|
12
|
-
|
|
13
|
-
Tencent Cloud Python Tmt SDK is the official software development kit, which allows Python developers to write software that makes use of Tencent Cloud services like CVM and CBS.
|
|
14
|
-
The SDK works on Python versions:
|
|
15
|
-
|
|
16
|
-
* 2.7 and greater, including 3.x
|
|
17
|
-
|
|
18
|
-
Quick Start
|
|
19
|
-
-----------
|
|
20
|
-
|
|
21
|
-
First, install the library:
|
|
22
|
-
|
|
23
|
-
.. code-block:: sh
|
|
24
|
-
|
|
25
|
-
$ pip install tencentcloud-sdk-python-common
|
|
26
|
-
$ pip install tencentcloud-sdk-python-tmt
|
|
27
|
-
|
|
28
|
-
or download source code from github and install:
|
|
29
|
-
|
|
30
|
-
.. code-block:: sh
|
|
31
|
-
|
|
32
|
-
$ git clone https://github.com/tencentcloud/tencentcloud-sdk-python.git
|
|
33
|
-
$ cd tencentcloud-sdk-python
|
|
34
|
-
$ python package.py --components common tmt
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
Platform: any
|
|
38
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
39
|
-
Classifier: Intended Audience :: Developers
|
|
40
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
41
|
-
Classifier: Programming Language :: Python
|
|
42
|
-
Classifier: Programming Language :: Python :: 2.7
|
|
43
|
-
Classifier: Programming Language :: Python :: 3
|
|
44
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
45
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 1.2
|
|
2
|
-
Name: tencentcloud-sdk-python-tmt
|
|
3
|
-
Version: 3.0.1460
|
|
4
|
-
Summary: Tencent Cloud Tmt SDK for Python
|
|
5
|
-
Home-page: https://github.com/TencentCloud/tencentcloud-sdk-python
|
|
6
|
-
Author: Tencent Cloud
|
|
7
|
-
Maintainer-email: tencentcloudapi@tencent.com
|
|
8
|
-
License: Apache License 2.0
|
|
9
|
-
Description: ============================
|
|
10
|
-
Tencent Cloud SDK for Python
|
|
11
|
-
============================
|
|
12
|
-
|
|
13
|
-
Tencent Cloud Python Tmt SDK is the official software development kit, which allows Python developers to write software that makes use of Tencent Cloud services like CVM and CBS.
|
|
14
|
-
The SDK works on Python versions:
|
|
15
|
-
|
|
16
|
-
* 2.7 and greater, including 3.x
|
|
17
|
-
|
|
18
|
-
Quick Start
|
|
19
|
-
-----------
|
|
20
|
-
|
|
21
|
-
First, install the library:
|
|
22
|
-
|
|
23
|
-
.. code-block:: sh
|
|
24
|
-
|
|
25
|
-
$ pip install tencentcloud-sdk-python-common
|
|
26
|
-
$ pip install tencentcloud-sdk-python-tmt
|
|
27
|
-
|
|
28
|
-
or download source code from github and install:
|
|
29
|
-
|
|
30
|
-
.. code-block:: sh
|
|
31
|
-
|
|
32
|
-
$ git clone https://github.com/tencentcloud/tencentcloud-sdk-python.git
|
|
33
|
-
$ cd tencentcloud-sdk-python
|
|
34
|
-
$ python package.py --components common tmt
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
Platform: any
|
|
38
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
39
|
-
Classifier: Intended Audience :: Developers
|
|
40
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
41
|
-
Classifier: Programming Language :: Python
|
|
42
|
-
Classifier: Programming Language :: Python :: 2.7
|
|
43
|
-
Classifier: Programming Language :: Python :: 3
|
|
44
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
45
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
tencentcloud-sdk-python-common<4.0.0,>=3.0.1460
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|