mdbq 3.1.6__py3-none-any.whl → 3.1.8__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.
@@ -61,7 +61,10 @@ class DataFrameConverter(object):
61
61
  if df[col].dtype == 'object':
62
62
  # "_"符号会被错误识别
63
63
  try:
64
- df[col] = df[col].apply(lambda x: int(x) if '_' not in str(x) and '.' not in str(x) else x) # 不含小数点尝试转整数
64
+ # 不能直接使用 int() ,对于大数,可能转为uint64,导致数据库入库可能异常
65
+ df[col] = df[col].apply(
66
+ lambda x: np.int64(str(x)) if '_' not in str(x) and '.' not in str(x) else x) # 不含小数点尝试转整数
67
+ # df[col] = df[col].apply(lambda x: int(x) if '_' not in str(x) and '.' not in str(x) else x) # 不含小数点尝试转整数
65
68
  except:
66
69
  pass
67
70
  if df[col].dtype == 'object':
mdbq/mysql/mysql.py CHANGED
@@ -381,8 +381,9 @@ class MysqlUpload:
381
381
  df[col] = df[col].apply(lambda x: float(re.sub(r'%$', '', str(x))) / 100 if (
382
382
  str(x) != '' and str(x).endswith('%')) and not re.findall('[\\u4e00-\\u9fa5]', str(x)) else '0.0' if str(x) == '0%' else x)
383
383
  try:
384
+ # 不能直接使用 int() ,对于大数,可能转为uint64,导致数据库入库可能异常
384
385
  df[col] = df[col].apply(
385
- lambda x: int(x) if '_' not in str(x) and '.' not in str(x) else x) # 不含小数点尝试转整数
386
+ lambda x: np.int64(str(x)) if '_' not in str(x) and '.' not in str(x) else x) # 不含小数点尝试转整数
386
387
  except:
387
388
  pass
388
389
  try:
@@ -978,6 +978,7 @@ def download_spu(username, password, host, port, col_name='白底图', save_path
978
978
  df['日期'] = df['日期'].astype('datetime64[ns]')
979
979
  df.sort_values(by=['商品id', '日期'], ascending=[False, True], ignore_index=True, inplace=True)
980
980
  df.drop_duplicates(subset=['商品id'], keep='last', inplace=True, ignore_index=True)
981
+ df = df.head(30)
981
982
  # df = df.head(2)
982
983
  if len(df) > 0:
983
984
  # 5. 实例化一个下载器类,并下载数据
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mdbq
3
- Version: 3.1.6
3
+ Version: 3.1.8
4
4
  Home-page: https://pypi.org/project/mdbq
5
5
  Author: xigua,
6
6
  Author-email: 2587125111@qq.com
@@ -21,18 +21,18 @@ mdbq/config/products.py,sha256=1W8FBXnnvTC29pBLI8Yp8UwTMhBvoppcJqmniT8rBGU,6295
21
21
  mdbq/config/set_support.py,sha256=xkZCX6y9Bq1ppBpJAofld4B2YtchA7fl0eT3dx3CrSI,777
22
22
  mdbq/config/update_conf.py,sha256=taL3ZqKgiVWwUrDFuaYhim9a72Hm4BHRhhDscJTziR8,4535
23
23
  mdbq/dataframe/__init__.py,sha256=2HtCN8AdRj53teXDqzysC1h8aPL-mMFy561ESmhehGQ,22
24
- mdbq/dataframe/converter.py,sha256=oKZF-Y7iybHlMnKsCXZkLEOJpfXdKHkH3rVWGhcr-C4,4608
24
+ mdbq/dataframe/converter.py,sha256=bHyfTUrYVMI7I7MoJzvmqM9A6QcjmH4qE18OiSoX-Dg,4911
25
25
  mdbq/log/__init__.py,sha256=Mpbrav0s0ifLL7lVDAuePEi1hJKiSHhxcv1byBKDl5E,15
26
26
  mdbq/log/mylogger.py,sha256=oaT7Bp-Hb9jZt52seP3ISUuxVcI19s4UiqTeouScBO0,3258
27
27
  mdbq/mongo/__init__.py,sha256=SILt7xMtQIQl_m-ik9WLtJSXIVf424iYgCfE_tnQFbw,13
28
28
  mdbq/mongo/mongo.py,sha256=v9qvrp6p1ZRWuPpbSilqveiE0FEcZF7U5xUPI0RN4xs,31880
29
29
  mdbq/mysql/__init__.py,sha256=A_DPJyAoEvTSFojiI2e94zP0FKtCkkwKP1kYUCSyQzo,11
30
- mdbq/mysql/mysql.py,sha256=LMW2bGYlUHfsOiDwVe9pTspIlMjixra6pvsVhM2PkNU,61540
30
+ mdbq/mysql/mysql.py,sha256=mIxlamozTv0smBRDCQF16ayqn4-OTmZD9QkNgnNftIw,61666
31
31
  mdbq/mysql/recheck_mysql.py,sha256=rgTpvDMWYTyEn7UQdlig-pdXDluTgiU8JG6lkMh8DV0,8665
32
32
  mdbq/mysql/s_query.py,sha256=30WilUkm6lsiI5HfGphnnBSVbAXiNsgn2mEPd7AhKJs,9055
33
33
  mdbq/mysql/year_month_day.py,sha256=VgewoE2pJxK7ErjfviL_SMTN77ki8GVbTUcao3vFUCE,1523
34
34
  mdbq/other/__init__.py,sha256=jso1oHcy6cJEfa7udS_9uO5X6kZLoPBF8l3wCYmr5dM,18
35
- mdbq/other/download_sku_picture.py,sha256=Daef1a_cCsh__2g1E8E0KRmZJI-3ERCxCY6CBLs9fuo,45805
35
+ mdbq/other/download_sku_picture.py,sha256=tlGh3oApJyH1vNva2PsMA-mdwl13tHdyLIOLO1FOyfo,45826
36
36
  mdbq/other/porxy.py,sha256=UHfgEyXugogvXgsG68a7QouUCKaohTKKkI4RN-kYSdQ,4961
37
37
  mdbq/other/pov_city.py,sha256=AEOmCOzOwyjHi9LLZWPKi6DUuSC-_M163664I52u9qw,21050
38
38
  mdbq/other/sku_picture.py,sha256=JwSXYlzamVqcKCD2tRH2VqYVZNr8fM6f--kcGlTVRnM,50026
@@ -45,7 +45,7 @@ mdbq/req_post/__init__.py,sha256=jso1oHcy6cJEfa7udS_9uO5X6kZLoPBF8l3wCYmr5dM,18
45
45
  mdbq/req_post/req_tb.py,sha256=qg7pet73IgKGmCwxaeUyImJIoeK_pBQT9BBKD7fkBNg,36160
46
46
  mdbq/spider/__init__.py,sha256=RBMFXGy_jd1HXZhngB2T2XTvJqki8P_Fr-pBcwijnew,18
47
47
  mdbq/spider/aikucun.py,sha256=48isoL6nEi_uniV-ja2HwYAI7O8D1i1goO4SzBwDGSU,19036
48
- mdbq-3.1.6.dist-info/METADATA,sha256=IZs4DKKHaPqctPAKkjYJ_i5GUblAJYA34vaqWYnkqqI,243
49
- mdbq-3.1.6.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
50
- mdbq-3.1.6.dist-info/top_level.txt,sha256=2FQ-uLnCSB-OwFiWntzmwosW3X2Xqsg0ewh1axsaylA,5
51
- mdbq-3.1.6.dist-info/RECORD,,
48
+ mdbq-3.1.8.dist-info/METADATA,sha256=3BkKptvgeELXXFhf9InK7NKm01QvWcYkPRNaQQra2qE,243
49
+ mdbq-3.1.8.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
50
+ mdbq-3.1.8.dist-info/top_level.txt,sha256=2FQ-uLnCSB-OwFiWntzmwosW3X2Xqsg0ewh1axsaylA,5
51
+ mdbq-3.1.8.dist-info/RECORD,,
File without changes