ey-commerce-lib 1.0.20__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.

@@ -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=5.0, read=20.0, write=10.0, pool=10.0)
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
 
@@ -182,6 +182,16 @@ def list_order_base_by_html(html_str: str) -> list[dict]:
182
182
  logistics_info['track_number'] = get_str_list_first_not_blank_or_none(
183
183
  order_first_element.xpath('.//td[6]//span[contains(@class, "limingcentUrlpicson")]/a/text()'))
184
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
+
185
195
  # 状态
186
196
  if has_logistics:
187
197
  status = get_str_list_first_not_blank_or_none(order_first_element.xpath('.//td[7]/text()'))
@@ -334,7 +344,8 @@ def get_order_detail_by_html(html_str: str):
334
344
  # 获取可用库存
335
345
  warehouse_available_quantity_element_list = pair_info_element.xpath(
336
346
  './/div[contains(@class, "normalDiv")]/p[2]/span[2]/text()')
337
- warehouse_available_quantity_str = get_str_list_first_not_blank_or_none(warehouse_available_quantity_element_list)
347
+ warehouse_available_quantity_str = get_str_list_first_not_blank_or_none(
348
+ warehouse_available_quantity_element_list)
338
349
  # 获取到可用库存节点
339
350
  if warehouse_available_quantity_str is not None:
340
351
  if warehouse_available_quantity_str.endswith('+'):
@@ -366,3 +377,21 @@ def get_order_detail_by_html(html_str: str):
366
377
  'pair_info_list': pair_info_list,
367
378
  'storage_id': storage_id
368
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
@@ -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=5.0, read=60.0, write=10.0, pool=10.0)
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",
@@ -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=5.0, read=20.0, write=10.0, pool=10.0)
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 __client_cc_order(self, excel_data: list):
33
+ async def client_cc_order(self, excel_data: list):
34
34
  """
35
35
  修改泰嘉产品上传重量数据
36
36
  :param excel_data:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ey-commerce-lib
3
- Version: 1.0.20
3
+ Version: 1.0.21
4
4
  Summary: eeyoung电商客户端调用封装
5
5
  Author-email: 饶奇奇 <1124393197@qq.com>
6
6
  Requires-Python: >=3.10
@@ -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=bSOdWpdeZ4CKglp5KWk-BbUHwdsAwhqXeUkXnjugf0Y,34029
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=kVnzUDpGvBgy_IWWGnA8C9PFpJG1vWWqq33WetTrbHE,18139
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=wkjaTv1d0lxYDUT9R0rnFpg1g4KW4ZLYW227xrs4ooM,2216
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=Omz7Wmo0bBzQvMA-_zVQG1sH-W-RsX5AeetFE2a1S0M,1569
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.20.dist-info/METADATA,sha256=Yb9R3yp3LqKqr7M9Z4WkCSEtxu6kq6UFQRH2cQVOvhg,391
59
- ey_commerce_lib-1.0.20.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
60
- ey_commerce_lib-1.0.20.dist-info/RECORD,,
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,,