mdbq 2.3.1__py3-none-any.whl → 2.3.3__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.
@@ -526,6 +526,9 @@ class DatabaseUpdate:
526
526
  elif name.endswith('.csv') and '竞店分析-来源分析-入店搜索词' in name:
527
527
  df = pd.read_csv(os.path.join(root, name), encoding='utf-8_sig', header=0, na_filter=False)
528
528
  check_remove_file = True
529
+ elif name.endswith('.csv') and '爱库存_商品榜单' in name:
530
+ df = pd.read_csv(os.path.join(root, name), encoding='utf-8_sig', header=0, na_filter=False)
531
+ check_remove_file = True
529
532
  # ----------------------- 京东数据处理分界线 -----------------------
530
533
  # ----------------------- 京东数据处理分界线 -----------------------
531
534
  elif name.endswith('.xlsx') and '店铺来源_流量来源' in name:
mdbq/clean/data_clean.py CHANGED
@@ -1336,6 +1336,9 @@ class DataClean:
1336
1336
  elif name.endswith('.csv') and '京东推广关键词点击成交报表' in name:
1337
1337
  t_path = str(pathlib.Path(self.source_path, '京东报表/JD推广_关键词报表'))
1338
1338
  bib(t_path, _as_month=True)
1339
+ elif name.endswith('.csv') and '爱库存' in name and '商品榜单' in name:
1340
+ t_path = str(pathlib.Path(self.source_path, '爱库存/商品榜单'))
1341
+ bib(t_path, _as_month=True)
1339
1342
  # 京东分界线 ------- 结束标记
1340
1343
 
1341
1344
  def attribute(self, path=None, _str='商品素材导出', ):
mdbq/spider/aikucun.py CHANGED
@@ -27,17 +27,20 @@ if platform.system() == 'Windows':
27
27
  Data_Path = r'C:\同步空间\BaiduSyncdisk'
28
28
  D_PATH = str(pathlib.Path(f'C:\\Users\\{getpass.getuser()}\\Downloads'))
29
29
  Share_Path = str(pathlib.Path(r'\\192.168.1.198\时尚事业部\01.运营部\天猫报表')) # 共享文件根目录
30
+ Source_Path = str(pathlib.Path(Data_Path, '原始文件2'))
30
31
  elif platform.system() == 'Linux':
31
32
  Data_Path = '数据中心'
32
33
  D_PATH = 'Downloads'
33
34
  if not os.path.exists(D_PATH):
34
35
  os.makedirs(D_PATH)
35
36
  Share_Path = '' # linux 通常是远程服务器,不需要访问共享
37
+ Source_Path = str(pathlib.Path(Data_Path, '原始文件2'))
36
38
  else:
37
39
  Data_Path = f'/Users/{getpass.getuser()}/数据中心' # 使用Mac独立网络时
38
40
  # Data_Path = '/Volumes' # 直接使用共享连接台式机时的配置, 后面接 + 自动0备份/***
39
41
  D_PATH = str(pathlib.Path(f'/Users/{getpass.getuser()}/Downloads'))
40
42
  Share_Path = str(pathlib.Path('/Volumes/时尚事业部/01.运营部/天猫报表')) # 共享文件根目录
43
+ Source_Path = str(pathlib.Path(Data_Path, '原始文件2'))
41
44
 
42
45
 
43
46
  def test():
@@ -251,6 +254,10 @@ class AikuCun:
251
254
  if not pattern:
252
255
  continue
253
256
  df = pd.read_csv(os.path.join(root, name), encoding='gb2312', header=0, na_filter=False)
257
+ if len(df) == 0:
258
+ print(f'数据长度为 0 : {name}')
259
+ os.remove(os.path.join(root, name))
260
+ continue
254
261
  df.insert(loc=0, column='日期', value=date) # df中插入新列
255
262
  df.rename(columns={'spuId': 'spu_id'}, inplace=True)
256
263
  df['数据更新时间'] = pd.to_datetime(df['数据更新时间'], format='%Y-%m-%d %H:%M:%S', errors='ignore')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mdbq
3
- Version: 2.3.1
3
+ Version: 2.3.3
4
4
  Home-page: https://pypi.org/project/mdbsql
5
5
  Author: xigua,
6
6
  Author-email: 2587125111@qq.com
@@ -1,7 +1,7 @@
1
1
  mdbq/__init__.py,sha256=Il5Q9ATdX8yXqVxtP_nYqUhExzxPC_qk_WXQ_4h0exg,16
2
2
  mdbq/__version__.py,sha256=y9Mp_8x0BCZSHsdLT_q5tX9wZwd5QgqrSIENLrb6vXA,62
3
3
  mdbq/aggregation/__init__.py,sha256=EeDqX2Aml6SPx8363J-v1lz0EcZtgwIBYyCJV6CcEDU,40
4
- mdbq/aggregation/aggregation.py,sha256=zA3aWCa2wmQ04Svv-MH_bdVuDnnatporKvfZ6lAqdEc,75757
4
+ mdbq/aggregation/aggregation.py,sha256=tt0l7ywcG0AFtBpKaiyqeqegWuOwB1-2K8VHbKn9qok,75995
5
5
  mdbq/aggregation/df_types.py,sha256=U9i3q2eRPTDY8qAPTw7irzu-Tlg4CIySW9uYro81wdk,8125
6
6
  mdbq/aggregation/mysql_types.py,sha256=DQYROALDiwjJzjhaJfIIdnsrNs11i5BORlj_v6bp67Y,11062
7
7
  mdbq/aggregation/optimize_data.py,sha256=Wis40oL04M7E1pkvgNPjyVFAUe-zgjimjIVAikxYY8Y,4418
@@ -9,7 +9,7 @@ mdbq/aggregation/query_data.py,sha256=Za8shm_I9ESzfYUVPRPOh8kk3yVWwvWAvwV0mFVx5m
9
9
  mdbq/bdup/__init__.py,sha256=AkhsGk81SkG1c8FqDH5tRq-8MZmFobVbN60DTyukYTY,28
10
10
  mdbq/bdup/bdup.py,sha256=LAV0TgnQpc-LB-YuJthxb0U42_VkPidzQzAagan46lU,4234
11
11
  mdbq/clean/__init__.py,sha256=A1d6x3L27j4NtLgiFV5TANwEkLuaDfPHDQNrPBbNWtU,41
12
- mdbq/clean/data_clean.py,sha256=ZJOTT0sNWP85x4pJl39UZBwN4Bnf8Ao-iVOJNiiRPEE,103996
12
+ mdbq/clean/data_clean.py,sha256=vSJsdDFeXpFo8ZRE3fiAsVulaS42aaUrHdvfmAI7KQQ,104230
13
13
  mdbq/company/__init__.py,sha256=qz8F_GsP_pMB5PblgJAUAMjasuZbOEp3qQOCB39E8f0,21
14
14
  mdbq/company/copysh.py,sha256=xjlfb-RwW0oLyyHQZFUtmXvCpWI7Y_nhwa0tqW14wZk,19345
15
15
  mdbq/company/home_sh.py,sha256=42CZ2tZIXHLl2mOl2gk2fZnjH2IHh1VJ1s3qHABjonY,18021
@@ -40,8 +40,8 @@ mdbq/pbix/refresh_all_old.py,sha256=_pq3WSQ728GPtEG5pfsZI2uTJhU8D6ra-htIk1JXYzw,
40
40
  mdbq/req_post/__init__.py,sha256=jso1oHcy6cJEfa7udS_9uO5X6kZLoPBF8l3wCYmr5dM,18
41
41
  mdbq/req_post/req_tb.py,sha256=P5RiXEgwQR44KhBcrgolFPipqILQ4eieDC7MpSWDlkE,18346
42
42
  mdbq/spider/__init__.py,sha256=RBMFXGy_jd1HXZhngB2T2XTvJqki8P_Fr-pBcwijnew,18
43
- mdbq/spider/aikucun.py,sha256=eg0Dx_Pi2VfuT8_oiCV96mqChG3CEkpa4D7hpaQD9eU,13533
44
- mdbq-2.3.1.dist-info/METADATA,sha256=Rn8Z2xEvcgSEXl0j8N6_chY3gqSWAVSVJD8oV1keqUc,245
45
- mdbq-2.3.1.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
46
- mdbq-2.3.1.dist-info/top_level.txt,sha256=2FQ-uLnCSB-OwFiWntzmwosW3X2Xqsg0ewh1axsaylA,5
47
- mdbq-2.3.1.dist-info/RECORD,,
43
+ mdbq/spider/aikucun.py,sha256=WJL_9Xik5C_Sk4AaPAwa3ncMR2KHxYh0R3C3CZaUpys,13916
44
+ mdbq-2.3.3.dist-info/METADATA,sha256=gptJFhHqyqxBjxIyHEwaaUXgvpBWsNW1dOvlY4ojZUs,245
45
+ mdbq-2.3.3.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
46
+ mdbq-2.3.3.dist-info/top_level.txt,sha256=2FQ-uLnCSB-OwFiWntzmwosW3X2Xqsg0ewh1axsaylA,5
47
+ mdbq-2.3.3.dist-info/RECORD,,
File without changes