reyfetch 1.0.36__py3-none-any.whl → 1.0.38__py3-none-any.whl
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.
- reyfetch/rali.py +11 -10
- reyfetch/rbaidu.py +10 -11
- reyfetch/rdouban.py +8 -4
- {reyfetch-1.0.36.dist-info → reyfetch-1.0.38.dist-info}/METADATA +2 -1
- {reyfetch-1.0.36.dist-info → reyfetch-1.0.38.dist-info}/RECORD +7 -7
- {reyfetch-1.0.36.dist-info → reyfetch-1.0.38.dist-info}/WHEEL +0 -0
- {reyfetch-1.0.36.dist-info → reyfetch-1.0.38.dist-info}/licenses/LICENSE +0 -0
reyfetch/rali.py
CHANGED
@@ -22,7 +22,7 @@ from .rbase import FetchRequest, FetchRequestWithDatabase, FetchRequestDatabaseR
|
|
22
22
|
|
23
23
|
|
24
24
|
__all__ = (
|
25
|
-
'
|
25
|
+
'DatabaseORMTableAliQwen',
|
26
26
|
'FetchRequestAli',
|
27
27
|
'FetchRequestAliQwen'
|
28
28
|
)
|
@@ -55,9 +55,9 @@ ChatReplyGenerator = Generator[str, Any, None]
|
|
55
55
|
ChatThinkGenerator = Generator[str, Any, None]
|
56
56
|
|
57
57
|
|
58
|
-
class
|
58
|
+
class DatabaseORMTableAliQwen(rorm.Model, table=True):
|
59
59
|
"""
|
60
|
-
Database `ali_qwen` table model.
|
60
|
+
Database `ali_qwen` table ORM model.
|
61
61
|
"""
|
62
62
|
|
63
63
|
__name__ = 'ali_qwen'
|
@@ -86,17 +86,14 @@ class FetchRequestAliQwen(FetchRequestAli, FetchRequestWithDatabase):
|
|
86
86
|
"""
|
87
87
|
Request Ali QWen API fetch type.
|
88
88
|
Can create database used `self.build_db` method.
|
89
|
-
|
90
|
-
Attributes
|
91
|
-
----------
|
92
|
-
url_api : API request URL.
|
93
|
-
url_doc : API document URL.
|
94
|
-
model = API AI model type.
|
95
89
|
"""
|
96
90
|
|
97
91
|
url_api = 'https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation'
|
92
|
+
'API request URL.'
|
98
93
|
url_doc = 'https://help.aliyun.com/zh/model-studio/use-qwen-by-calling-api?spm=a2c4g.11186623.0.0.330e7d9dSBCaZQ'
|
94
|
+
'API document URL.'
|
99
95
|
model = 'qwen-turbo-latest'
|
96
|
+
'API AI model type.'
|
100
97
|
|
101
98
|
|
102
99
|
def __init__(
|
@@ -138,6 +135,10 @@ class FetchRequestAliQwen(FetchRequestAli, FetchRequestWithDatabase):
|
|
138
135
|
# Database.
|
139
136
|
self.db_record = FetchRequestDatabaseRecord(self, 'ali_qwen')
|
140
137
|
|
138
|
+
## Build Database.
|
139
|
+
if self.db is not None:
|
140
|
+
self.build_db()
|
141
|
+
|
141
142
|
|
142
143
|
@overload
|
143
144
|
def request(self, json: dict, stream: Literal[True]) -> Iterable[str]: ...
|
@@ -838,7 +839,7 @@ class FetchRequestAliQwen(FetchRequestAli, FetchRequestWithDatabase):
|
|
838
839
|
database = self.db.database
|
839
840
|
|
840
841
|
## Table.
|
841
|
-
tables = [
|
842
|
+
tables = [DatabaseORMTableAliQwen]
|
842
843
|
|
843
844
|
## View stats.
|
844
845
|
views_stats = [
|
reyfetch/rbaidu.py
CHANGED
@@ -24,7 +24,7 @@ from .rbase import FetchRequest, FetchRequestWithDatabase, FetchRequestDatabaseR
|
|
24
24
|
|
25
25
|
|
26
26
|
__all__ = (
|
27
|
-
'
|
27
|
+
'DatabaseORMTableBaiduTrans',
|
28
28
|
'FetchRequestBaidu',
|
29
29
|
'FetchRequestBaiduTranslateLangEnum',
|
30
30
|
'FetchRequestBaiduTranslateLangAutoEnum',
|
@@ -37,9 +37,9 @@ FanyiResponseResult = TypedDict('FanyiResponseResult', {'src': str, 'dst': str})
|
|
37
37
|
FanyiResponse = TypedDict('FanyiResponse', {'from': str, 'to': str, 'trans_result': list[FanyiResponseResult]})
|
38
38
|
|
39
39
|
|
40
|
-
class
|
40
|
+
class DatabaseORMTableBaiduTrans(rorm.Model, table=True):
|
41
41
|
"""
|
42
|
-
Database `baidu_trans` table model.
|
42
|
+
Database `baidu_trans` table ORM model.
|
43
43
|
"""
|
44
44
|
|
45
45
|
__name__ = 'baidu_trans'
|
@@ -106,17 +106,12 @@ class FetchRequestBaiduTranslate(FetchRequestBaidu, FetchRequestWithDatabase):
|
|
106
106
|
"""
|
107
107
|
Request Baidu translate API fetch type.
|
108
108
|
Can create database used `self.build_db` method.
|
109
|
-
|
110
|
-
Attributes
|
111
|
-
----------
|
112
|
-
url_api : API request URL.
|
113
|
-
url_doc : API document URL.
|
114
|
-
LangEnum : Baidu Fanyi APT language enumeration type.
|
115
|
-
LangEnum : Baidu Fanyi APT language auto type enumeration.
|
116
109
|
"""
|
117
110
|
|
118
111
|
url_api = 'http://api.fanyi.baidu.com/api/trans/vip/translate'
|
112
|
+
'API request URL.'
|
119
113
|
url_doc = 'https://fanyi-api.baidu.com/product/113'
|
114
|
+
'API document URL.'
|
120
115
|
LangEnum = FetchRequestBaiduTranslateLangEnum
|
121
116
|
LangAutoEnum = FetchRequestBaiduTranslateLangAutoEnum
|
122
117
|
|
@@ -148,6 +143,10 @@ class FetchRequestBaiduTranslate(FetchRequestBaidu, FetchRequestWithDatabase):
|
|
148
143
|
# Database.
|
149
144
|
self.db_record = FetchRequestDatabaseRecord(self, 'baidu_trans')
|
150
145
|
|
146
|
+
## Build Database.
|
147
|
+
if self.db is not None:
|
148
|
+
self.build_db()
|
149
|
+
|
151
150
|
|
152
151
|
def sign(self, text: str, num: int) -> str:
|
153
152
|
"""
|
@@ -337,7 +336,7 @@ class FetchRequestBaiduTranslate(FetchRequestBaidu, FetchRequestWithDatabase):
|
|
337
336
|
database = self.db.database
|
338
337
|
|
339
338
|
## Table.
|
340
|
-
tables = [
|
339
|
+
tables = [DatabaseORMTableBaiduTrans]
|
341
340
|
|
342
341
|
## View stats.
|
343
342
|
views_stats = [
|
reyfetch/rdouban.py
CHANGED
@@ -21,7 +21,7 @@ from .rbase import FetchCrawl
|
|
21
21
|
|
22
22
|
|
23
23
|
__all__ = (
|
24
|
-
'
|
24
|
+
'DatabaseORMTableDoubanMedia',
|
25
25
|
'FetchCrawlDouban'
|
26
26
|
)
|
27
27
|
|
@@ -72,9 +72,9 @@ MediaInfo = TypedDict(
|
|
72
72
|
)
|
73
73
|
|
74
74
|
|
75
|
-
class
|
75
|
+
class DatabaseORMTableDoubanMedia(rorm.Model, table=True):
|
76
76
|
"""
|
77
|
-
Database `douban_media` table model.
|
77
|
+
Database `douban_media` table ORM model.
|
78
78
|
"""
|
79
79
|
|
80
80
|
__name__ = 'douban_media'
|
@@ -126,6 +126,10 @@ class FetchCrawlDouban(FetchCrawl):
|
|
126
126
|
# Build.
|
127
127
|
self.db = db
|
128
128
|
|
129
|
+
# Build Database.
|
130
|
+
if self.db is not None:
|
131
|
+
self.build_db()
|
132
|
+
|
129
133
|
|
130
134
|
def crawl_table(self) -> MediaTable:
|
131
135
|
"""
|
@@ -474,7 +478,7 @@ class FetchCrawlDouban(FetchCrawl):
|
|
474
478
|
database = self.db.database
|
475
479
|
|
476
480
|
## Table.
|
477
|
-
tables = [
|
481
|
+
tables = [DatabaseORMTableDoubanMedia]
|
478
482
|
|
479
483
|
## View stats.
|
480
484
|
views_stats = [
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: reyfetch
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.38
|
4
4
|
Summary: Web data fetch method set.
|
5
5
|
Project-URL: homepage, https://github.com/reyxbo/reyfetch/
|
6
6
|
Author-email: Rey <reyxbo@163.com>
|
@@ -15,6 +15,7 @@ License-File: LICENSE
|
|
15
15
|
Keywords: crawl Web,fetch,request API,rey,reyxbo
|
16
16
|
Requires-Python: >=3.12
|
17
17
|
Requires-Dist: fake-useragent
|
18
|
+
Requires-Dist: reydb
|
18
19
|
Requires-Dist: reykit
|
19
20
|
Requires-Dist: selenium
|
20
21
|
Description-Content-Type: text/markdown
|
@@ -1,14 +1,14 @@
|
|
1
1
|
reyfetch/__init__.py,sha256=gDkQmFLZGToSqb1HVfvGxvc9t3mt8slg7_MVc44llns,484
|
2
|
-
reyfetch/rali.py,sha256=
|
2
|
+
reyfetch/rali.py,sha256=mvcY67THU7dYVku13r7LEC5hmZauI1NcLV7pLC6NC5o,33135
|
3
3
|
reyfetch/rall.py,sha256=86TMZiNsv-UinZ2L3_m3ugTHekUWnfVlWMedte0MOwQ,350
|
4
|
-
reyfetch/rbaidu.py,sha256=
|
4
|
+
reyfetch/rbaidu.py,sha256=MIaJwk3RgaoCKj7ig3InhvlUV6iqzwkxnBoI8wtL1RU,13464
|
5
5
|
reyfetch/rbase.py,sha256=7sXZyTsu-Tw2cEdusUf5xiyPFE1e7lEx0W0Oc6pGKHE,4800
|
6
|
-
reyfetch/rdouban.py,sha256=
|
6
|
+
reyfetch/rdouban.py,sha256=O-NfGkwfBQKsv9fO8MxCYjuEEYb8PKuL_8xLhluZ2NE,18959
|
7
7
|
reyfetch/rgeneral.py,sha256=s270rtlVv1owkGF57Tjs8Oc5bJRD_XtWISpKlEJ7mbE,3797
|
8
8
|
reyfetch/rsina.py,sha256=WONT6NN67seYjlvXZ39RbibticdDAuauGk6SAvtdEq8,6889
|
9
9
|
reyfetch/rtoutiao.py,sha256=zLPnf2_XSC0d2RZgtMVoVyWpA2UDGNXYpRjYi3DGabI,1671
|
10
10
|
reyfetch/rweibo.py,sha256=T58q6wOv0p7j6WBH4we5k9x8IgFhQN__wqsqTHYMbmU,2522
|
11
|
-
reyfetch-1.0.
|
12
|
-
reyfetch-1.0.
|
13
|
-
reyfetch-1.0.
|
14
|
-
reyfetch-1.0.
|
11
|
+
reyfetch-1.0.38.dist-info/METADATA,sha256=YFQFV93HWV7y2jIKoFaLA2PQTQZbxYWC_1MQRT_jfd4,1610
|
12
|
+
reyfetch-1.0.38.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
13
|
+
reyfetch-1.0.38.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
14
|
+
reyfetch-1.0.38.dist-info/RECORD,,
|
File without changes
|
File without changes
|