ey-commerce-lib 1.0.19__py3-none-any.whl → 1.0.21__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.
Potentially problematic release.
This version of ey-commerce-lib might be problematic. Click here for more details.
- ey_commerce_lib/dxm/main.py +34 -2
- ey_commerce_lib/dxm/parser/order.py +40 -5
- ey_commerce_lib/kogan/main.py +1 -1
- ey_commerce_lib/takesend/main.py +2 -2
- {ey_commerce_lib-1.0.19.dist-info → ey_commerce_lib-1.0.21.dist-info}/METADATA +1 -1
- {ey_commerce_lib-1.0.19.dist-info → ey_commerce_lib-1.0.21.dist-info}/RECORD +7 -7
- {ey_commerce_lib-1.0.19.dist-info → ey_commerce_lib-1.0.21.dist-info}/WHEEL +0 -0
ey_commerce_lib/dxm/main.py
CHANGED
|
@@ -9,7 +9,7 @@ from ey_commerce_lib.dxm.constant.order import DxmOrderRuleType
|
|
|
9
9
|
from ey_commerce_lib.dxm.parser.common import get_page_info, get_purchase_pagination_info, get_tracking_page_info
|
|
10
10
|
from ey_commerce_lib.dxm.parser.count import parse_count
|
|
11
11
|
from ey_commerce_lib.dxm.parser.order import list_order_base_by_html, list_order_rule, get_rule_detail, \
|
|
12
|
-
get_order_detail_by_html
|
|
12
|
+
get_order_detail_by_html, parse_comm_search_list_html_get_authid_dict
|
|
13
13
|
from ey_commerce_lib.dxm.parser.purchase import list_purchasing_all, list_1688_purchase_order_number, \
|
|
14
14
|
list_wait_pay_page_purchase_order_number
|
|
15
15
|
from ey_commerce_lib.dxm.parser.tracking import parse_tracking_page
|
|
@@ -28,7 +28,7 @@ class DxmClient:
|
|
|
28
28
|
self.__cookies = cookies
|
|
29
29
|
self.__headers = headers
|
|
30
30
|
self.__sem = asyncio.Semaphore(sem)
|
|
31
|
-
timeout = Timeout(connect=
|
|
31
|
+
timeout = Timeout(connect=60.0, read=60.0, write=60.0, pool=30.0)
|
|
32
32
|
self.__base_url = 'https://www.dianxiaomi.com'
|
|
33
33
|
self.__async_client = AsyncClient(base_url=self.__base_url, cookies=cookies, headers=headers,
|
|
34
34
|
timeout=timeout)
|
|
@@ -847,6 +847,38 @@ class DxmClient:
|
|
|
847
847
|
})
|
|
848
848
|
return order_prior_or_ban_ship_response.json()
|
|
849
849
|
|
|
850
|
+
async def reply_msg(self, package_id: str, content: str):
|
|
851
|
+
"""
|
|
852
|
+
回复消息
|
|
853
|
+
"""
|
|
854
|
+
data = f'packageId={package_id}&content={content}'
|
|
855
|
+
async with self.__sem:
|
|
856
|
+
reply_msg_response = await self.__async_client.post('/replyMsg/reply.json', content=data)
|
|
857
|
+
return reply_msg_response.json()
|
|
858
|
+
|
|
859
|
+
async def get_authid_like_keyword(self, keyword: str) -> dict:
|
|
860
|
+
"""
|
|
861
|
+
获取店小秘物流方式id,通过关键字模糊查询
|
|
862
|
+
:param keyword: 关键字
|
|
863
|
+
:return:
|
|
864
|
+
"""
|
|
865
|
+
async with self.__sem:
|
|
866
|
+
data = {
|
|
867
|
+
'state': '',
|
|
868
|
+
'isVoided': '-1',
|
|
869
|
+
'isOversea': '-1',
|
|
870
|
+
'commitPlatform': '',
|
|
871
|
+
'prefixCount': '200',
|
|
872
|
+
'newVersion': '0',
|
|
873
|
+
'history': '',
|
|
874
|
+
'isBatch': '-1',
|
|
875
|
+
'isFree': '-1',
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
response = await self.__async_client.post('/package/commSearchList.htm', data=data)
|
|
879
|
+
comm_search_list_html = response.text
|
|
880
|
+
return parse_comm_search_list_html_get_authid_dict(comm_search_list_html, keyword)
|
|
881
|
+
|
|
850
882
|
async def __aenter__(self):
|
|
851
883
|
return self
|
|
852
884
|
|
|
@@ -26,11 +26,16 @@ def get_single_order_item_list(order_element: html.HtmlElement):
|
|
|
26
26
|
variants = sku_element.xpath(
|
|
27
27
|
'.//p[@class="pairProInfoName orderPairNameIsOverlength"]/span[@class="isOverLengThHide"]/text()')
|
|
28
28
|
variant_list = list()
|
|
29
|
+
# 原来的变种
|
|
30
|
+
origin_variants = []
|
|
29
31
|
for variant in variants:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
if len(variant.split(':')) == 2:
|
|
33
|
+
variant_list.append({
|
|
34
|
+
'name': variant.split(':')[0].strip(),
|
|
35
|
+
'value': variant.split(':')[1].strip()
|
|
36
|
+
})
|
|
37
|
+
else:
|
|
38
|
+
origin_variants.append(variant)
|
|
34
39
|
# 获取来源数据
|
|
35
40
|
source_presentation_element_list = (sku_element.
|
|
36
41
|
xpath('.//ul[@id="dropSourceUrl"]/li[@role="presentation"]/a/text()'))
|
|
@@ -47,6 +52,7 @@ def get_single_order_item_list(order_element: html.HtmlElement):
|
|
|
47
52
|
'currency': currency,
|
|
48
53
|
'img': img,
|
|
49
54
|
'variants': variant_list,
|
|
55
|
+
'origin_variants': origin_variants,
|
|
50
56
|
'source_list': source_presentation_element_list
|
|
51
57
|
})
|
|
52
58
|
# 订单金额
|
|
@@ -176,6 +182,16 @@ def list_order_base_by_html(html_str: str) -> list[dict]:
|
|
|
176
182
|
logistics_info['track_number'] = get_str_list_first_not_blank_or_none(
|
|
177
183
|
order_first_element.xpath('.//td[6]//span[contains(@class, "limingcentUrlpicson")]/a/text()'))
|
|
178
184
|
logistics_info['logistics'] = logistics
|
|
185
|
+
# 称重重量
|
|
186
|
+
weight_element_list = order_first_element.xpath('.//td[6]//span[@class="gray-c"]/text()')
|
|
187
|
+
weight = None
|
|
188
|
+
for weight_element in weight_element_list:
|
|
189
|
+
if '称重重量' in weight_element:
|
|
190
|
+
# 如果包含了称重重量的话,获取完整的数字部分
|
|
191
|
+
weight = float(re.search(r'\d+(?:\.\d+)?', weight_element).group())
|
|
192
|
+
# 设置重量部分
|
|
193
|
+
logistics_info['weight'] = weight
|
|
194
|
+
|
|
179
195
|
# 状态
|
|
180
196
|
if has_logistics:
|
|
181
197
|
status = get_str_list_first_not_blank_or_none(order_first_element.xpath('.//td[7]/text()'))
|
|
@@ -328,7 +344,8 @@ def get_order_detail_by_html(html_str: str):
|
|
|
328
344
|
# 获取可用库存
|
|
329
345
|
warehouse_available_quantity_element_list = pair_info_element.xpath(
|
|
330
346
|
'.//div[contains(@class, "normalDiv")]/p[2]/span[2]/text()')
|
|
331
|
-
warehouse_available_quantity_str = get_str_list_first_not_blank_or_none(
|
|
347
|
+
warehouse_available_quantity_str = get_str_list_first_not_blank_or_none(
|
|
348
|
+
warehouse_available_quantity_element_list)
|
|
332
349
|
# 获取到可用库存节点
|
|
333
350
|
if warehouse_available_quantity_str is not None:
|
|
334
351
|
if warehouse_available_quantity_str.endswith('+'):
|
|
@@ -360,3 +377,21 @@ def get_order_detail_by_html(html_str: str):
|
|
|
360
377
|
'pair_info_list': pair_info_list,
|
|
361
378
|
'storage_id': storage_id
|
|
362
379
|
}
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
def parse_comm_search_list_html_get_authid_dict(html_str: str, keyword: str):
|
|
383
|
+
"""
|
|
384
|
+
解析网页获取物流方式id字典
|
|
385
|
+
:param html_str:
|
|
386
|
+
:param keyword:
|
|
387
|
+
:return:
|
|
388
|
+
"""
|
|
389
|
+
tree = html.fromstring(html_str)
|
|
390
|
+
logistics_authid_dict = {}
|
|
391
|
+
logistics_method_element_list = tree.xpath('//select[@id="advancedAuthSelect"]/option')
|
|
392
|
+
for logistics_method in logistics_method_element_list:
|
|
393
|
+
logistics_authid_text = str(logistics_method.xpath('text()')[0])
|
|
394
|
+
logistics_authid_value = logistics_method.xpath('@value')[0]
|
|
395
|
+
if keyword in logistics_authid_text:
|
|
396
|
+
logistics_authid_dict[logistics_authid_text] = logistics_authid_value
|
|
397
|
+
return logistics_authid_dict
|
ey_commerce_lib/kogan/main.py
CHANGED
|
@@ -11,7 +11,7 @@ class KoganClient:
|
|
|
11
11
|
def __init__(self, seller_id: str, seller_token: str):
|
|
12
12
|
self.seller_id = seller_id
|
|
13
13
|
self.seller_token = seller_token
|
|
14
|
-
timeout = Timeout(connect=
|
|
14
|
+
timeout = Timeout(connect=60.0, read=60.0, write=60.0, pool=30.0)
|
|
15
15
|
|
|
16
16
|
# 异步客户端
|
|
17
17
|
self.__async_client = AsyncClient(base_url="https://nimda.kogan.com",
|
ey_commerce_lib/takesend/main.py
CHANGED
|
@@ -6,7 +6,7 @@ from ey_commerce_lib.takesend.config import LOGIN_HEADERS, EDIT_HEADERS
|
|
|
6
6
|
class TakeSendClient(object):
|
|
7
7
|
|
|
8
8
|
def __init__(self, username: str, password: str):
|
|
9
|
-
timeout = Timeout(connect=
|
|
9
|
+
timeout = Timeout(connect=60.0, read=60.0, write=60.0, pool=30.0)
|
|
10
10
|
self.__async_client = AsyncClient(
|
|
11
11
|
base_url="http://k5.takesend.com:8180",
|
|
12
12
|
timeout=timeout)
|
|
@@ -30,7 +30,7 @@ class TakeSendClient(object):
|
|
|
30
30
|
}
|
|
31
31
|
await self.__async_client.post("//client/Logon", params=params, data=data, headers=LOGIN_HEADERS)
|
|
32
32
|
|
|
33
|
-
async def
|
|
33
|
+
async def client_cc_order(self, excel_data: list):
|
|
34
34
|
"""
|
|
35
35
|
修改泰嘉产品上传重量数据
|
|
36
36
|
:param excel_data:
|
|
@@ -2,7 +2,7 @@ ey_commerce_lib/__init__.py,sha256=QTYqXqSTHFRkM9TEgpDFcHvwLbvqHDqvqfQ9EiXkcAM,2
|
|
|
2
2
|
ey_commerce_lib/model.py,sha256=0ZCE68502blzRDsQ38AIswc8kPk7H34Am5x8IiDi2DU,232
|
|
3
3
|
ey_commerce_lib/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
ey_commerce_lib/dxm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
ey_commerce_lib/dxm/main.py,sha256=
|
|
5
|
+
ey_commerce_lib/dxm/main.py,sha256=SU1e5L_rPMbS9QZJmB8I-jirBr5_rWu3I2ZQ2vNuUz0,35274
|
|
6
6
|
ey_commerce_lib/dxm/order.py,sha256=hMdNm9X5h9tbvMWFnyE5hcSF4butzn7m-akGqLQUD0k,35
|
|
7
7
|
ey_commerce_lib/dxm/constant/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
ey_commerce_lib/dxm/constant/order.py,sha256=U-2NYnkIcqukzMtOFpfqvzIktu_t7jYEms_n9LgKMlY,2213
|
|
@@ -12,7 +12,7 @@ ey_commerce_lib/dxm/parser/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
|
12
12
|
ey_commerce_lib/dxm/parser/common.py,sha256=srzjwl7CviDgv0vizDC3RO2cbkQG9Pl-JpQpGAO5U14,3627
|
|
13
13
|
ey_commerce_lib/dxm/parser/count.py,sha256=WOrGeA6DP6_IBtiF1TEZhW528f8kHxlT2cpmg_7FKPM,1561
|
|
14
14
|
ey_commerce_lib/dxm/parser/ebay_product.py,sha256=Ub6of2YhFnXQwZiFBvZa6wnTIsGbsedAKHW92dbBHIY,589
|
|
15
|
-
ey_commerce_lib/dxm/parser/order.py,sha256=
|
|
15
|
+
ey_commerce_lib/dxm/parser/order.py,sha256=9At7M1mlTslGnCO-BfjAFXNT9SPabXtTG38dnShluKI,19448
|
|
16
16
|
ey_commerce_lib/dxm/parser/purchase.py,sha256=lmcC41HtdUqCgGamFASPnzHatUziLFaenTJmazsiMm0,5750
|
|
17
17
|
ey_commerce_lib/dxm/parser/tracking.py,sha256=ND7Xo31lMycmRLXIYtPAXqOh2W-tmeFE8t-f-sNDLLI,2629
|
|
18
18
|
ey_commerce_lib/dxm/parser/warehouse.py,sha256=oQVojPX8VKHUphdV1KY5ZK1PCFtOY2zwkyLNUeJ3JT0,3310
|
|
@@ -38,7 +38,7 @@ ey_commerce_lib/four_seller/schemas/query/order.py,sha256=XV7by4RT9NWvei4C__cQsL
|
|
|
38
38
|
ey_commerce_lib/four_seller/schemas/vo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
39
39
|
ey_commerce_lib/four_seller/schemas/vo/order.py,sha256=c-Z6KQRugsJmxQJEztsH1nzqrg3KvK4Q5xm6xEyjbJM,12135
|
|
40
40
|
ey_commerce_lib/kogan/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
|
-
ey_commerce_lib/kogan/main.py,sha256=
|
|
41
|
+
ey_commerce_lib/kogan/main.py,sha256=4Kh6M_fIjxXrV3HjuXC7JB3cYfhxJh1rpdteQAKDAGg,2217
|
|
42
42
|
ey_commerce_lib/kogan/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
43
|
ey_commerce_lib/kogan/schemas/query/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
44
44
|
ey_commerce_lib/kogan/schemas/query/order.py,sha256=ajqO992fiorUDg3-YPPpK2Dgmdy2LoHfz4IatBz1Mro,574
|
|
@@ -48,13 +48,13 @@ ey_commerce_lib/kogan/schemas/response/order.py,sha256=ATWks8Erv9HmW9t_UklYRMn4s
|
|
|
48
48
|
ey_commerce_lib/kogan/schemas/response/product.py,sha256=IVC1QSHSYZyHa4lCYz20rTdtmPvpPoqJsQP88hu48S4,2773
|
|
49
49
|
ey_commerce_lib/takesend/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
50
|
ey_commerce_lib/takesend/config.py,sha256=doR1mzVL3hrDY8luVT1_hRIGAc2_ZaTgYS8-SBU__Js,1260
|
|
51
|
-
ey_commerce_lib/takesend/main.py,sha256=
|
|
51
|
+
ey_commerce_lib/takesend/main.py,sha256=kYnRQxAgLWagyKr8ilLG7XrF2sG0ANoXoVm47fAANZ8,1568
|
|
52
52
|
ey_commerce_lib/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
53
|
ey_commerce_lib/utils/close.py,sha256=-De_H1I-gryytKYhLMsC3HfW67W852XkP1ckK2gLsFs,141
|
|
54
54
|
ey_commerce_lib/utils/dxm.py,sha256=jVNltK_Pm_yMzXReD0Aw5VW6kzIZ5Bn23RucS0DKBI0,1196
|
|
55
55
|
ey_commerce_lib/utils/float.py,sha256=PiOMf9pRApc1DskKkhKx0LAWHAYTpAPT_G4QRZRd8ZU,905
|
|
56
56
|
ey_commerce_lib/utils/list_util.py,sha256=R1w7B1m3sEXr38zSHWp-15C3xAs5ykYCCpvwmnRW4xs,545
|
|
57
57
|
ey_commerce_lib/utils/str.py,sha256=939xE0y8U7KEWjwbEezMlaWJNBsfb2BSb-dBpYbOD8Q,138
|
|
58
|
-
ey_commerce_lib-1.0.
|
|
59
|
-
ey_commerce_lib-1.0.
|
|
60
|
-
ey_commerce_lib-1.0.
|
|
58
|
+
ey_commerce_lib-1.0.21.dist-info/METADATA,sha256=gy3nsyb6elHZ7EdZlmzSkyuphYwOpmK9u1OUoN1IF3k,391
|
|
59
|
+
ey_commerce_lib-1.0.21.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
60
|
+
ey_commerce_lib-1.0.21.dist-info/RECORD,,
|
|
File without changes
|