ey-commerce-lib 1.0.18__py3-none-any.whl → 1.0.19__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.

@@ -822,6 +822,31 @@ class DxmClient:
822
822
  result.extend(page_data.records)
823
823
  return result
824
824
 
825
+ async def tracking_show_detail(self, tracking_number: str, carrier_code: str):
826
+ """
827
+ 物流追踪详情信息
828
+ """
829
+ async with self.__sem:
830
+ tracking_show_detail_response = await self.__async_client.post('/tracking/showDetail.json', data={
831
+ "trackingNumber": tracking_number,
832
+ "carrierCode": carrier_code
833
+ })
834
+ return tracking_show_detail_response.json()
835
+
836
+ async def order_prior_or_ban_ship(self, package_id: str, type_value: str):
837
+ """
838
+ 禁运或优先发货
839
+ :param package_id:
840
+ :param type_value:
841
+ :return:
842
+ """
843
+ async with self.__sem:
844
+ order_prior_or_ban_ship_response = await self.__async_client.post('/order/orderPriorOrBanShip.json', data={
845
+ 'packageId': package_id,
846
+ 'type': type_value,
847
+ })
848
+ return order_prior_or_ban_ship_response.json()
849
+
825
850
  async def __aenter__(self):
826
851
  return self
827
852
 
@@ -37,13 +37,13 @@ def get_single_order_item_list(order_element: html.HtmlElement):
37
37
  source_presentation_element_list = [source_presentation_element.strip().split(':')[1]
38
38
  for source_presentation_element in source_presentation_element_list]
39
39
  try:
40
- float(price.replace(',', ''))
41
- except:
42
- raise Exception(f'价格格式错误, sku是{sku}--价格是{price}')
40
+ price = float(price.replace(',', ''))
41
+ except Exception:
42
+ price = None
43
43
  sku_list.append({
44
44
  'sku': sku,
45
45
  'quantity': int(quantity),
46
- 'price': float(price.replace(',', '')),
46
+ 'price': price,
47
47
  'currency': currency,
48
48
  'img': img,
49
49
  'variants': variant_list,
@@ -319,21 +319,23 @@ def get_order_detail_by_html(html_str: str):
319
319
  pair_info_sku = pair_info_element.xpath('.//span[@class="pairProInfoSku"]/text()')[0].split(' x')[0].strip()
320
320
  pair_info_sku_quantity = int(pair_info_element.xpath('.//span[@class="pairProInfoSku"]/span/text()')[0].strip())
321
321
  proid = get_str_list_first_not_blank_or_none(pair_info_element.xpath('.//input[@proid]/@proid'))
322
- # warehouse_sku, warehouse_sku_quantity = pair_info_element.xpath(
323
- # './/div[contains(@class, "normalDiv")]/p[1]/text()')[0].split(' x ')
324
322
  warehouse_sku_info_list = pair_info_element.xpath('.//div[contains(@class, "normalDiv")]/p[1]/text()')
325
323
  warehouse_sku, warehouse_sku_quantity = None, None
326
324
  if len(warehouse_sku_info_list) > 0:
327
325
  warehouse_sku_info = warehouse_sku_info_list[0]
328
326
  warehouse_sku, warehouse_sku_quantity = warehouse_sku_info.split(' x ')
329
327
 
328
+ # 获取可用库存
330
329
  warehouse_available_quantity_element_list = pair_info_element.xpath(
331
330
  './/div[contains(@class, "normalDiv")]/p[2]/span[2]/text()')
332
- warehouse_available_quantity_str = warehouse_available_quantity_element_list[0].strip()
333
- if warehouse_available_quantity_str.endswith('+'):
334
- warehouse_available_quantity_str = warehouse_available_quantity_str[:-1]
335
- warehouse_available_quantity = int(warehouse_available_quantity_str) if len(
336
- warehouse_available_quantity_element_list) > 0 else None
331
+ warehouse_available_quantity_str = get_str_list_first_not_blank_or_none(warehouse_available_quantity_element_list)
332
+ # 获取到可用库存节点
333
+ if warehouse_available_quantity_str is not None:
334
+ if warehouse_available_quantity_str.endswith('+'):
335
+ warehouse_available_quantity_str = warehouse_available_quantity_str[:-1]
336
+ warehouse_available_quantity = int(warehouse_available_quantity_str)
337
+ else:
338
+ warehouse_available_quantity = None
337
339
  pair_info_list.append({
338
340
  'pair_info_sku': pair_info_sku,
339
341
  'pair_info_sku_quantity': pair_info_sku_quantity,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ey-commerce-lib
3
- Version: 1.0.18
3
+ Version: 1.0.19
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=XJ_n9aiLK9QOJ6b-eypwk3slbdV4C5d-vs9ceGG3zfI,33048
5
+ ey_commerce_lib/dxm/main.py,sha256=bSOdWpdeZ4CKglp5KWk-BbUHwdsAwhqXeUkXnjugf0Y,34029
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=vnu5jqea8IoTGk_kFlDcUnrZF5NKuBIQUGAYaxQVSg4,17972
15
+ ey_commerce_lib/dxm/parser/order.py,sha256=ApFa02xFovrrJ4JHPL9NEJisKQO5v8NV485TpfmKgYA,17901
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
@@ -55,6 +55,6 @@ ey_commerce_lib/utils/dxm.py,sha256=jVNltK_Pm_yMzXReD0Aw5VW6kzIZ5Bn23RucS0DKBI0,
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.18.dist-info/METADATA,sha256=izsvwLI_75aS7a_ZkpSmdGrXiRO4aXE2yMyMMAkJj3U,391
59
- ey_commerce_lib-1.0.18.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
60
- ey_commerce_lib-1.0.18.dist-info/RECORD,,
58
+ ey_commerce_lib-1.0.19.dist-info/METADATA,sha256=7jzqPSilBEag4mOkYasADvKEZd3i3PsxjuszRyxmWso,391
59
+ ey_commerce_lib-1.0.19.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
60
+ ey_commerce_lib-1.0.19.dist-info/RECORD,,