mdbq 2.8.2__tar.gz → 2.8.4__tar.gz

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.
Files changed (55) hide show
  1. {mdbq-2.8.2 → mdbq-2.8.4}/PKG-INFO +1 -1
  2. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/clean/clean_upload.py +5 -1
  3. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/company/copysh.py +25 -24
  4. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/pbix/refresh_all.py +1 -1
  5. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq.egg-info/PKG-INFO +1 -1
  6. {mdbq-2.8.2 → mdbq-2.8.4}/setup.py +1 -1
  7. {mdbq-2.8.2 → mdbq-2.8.4}/README.txt +0 -0
  8. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/__init__.py +0 -0
  9. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/__version__.py +0 -0
  10. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/aggregation/__init__.py +0 -0
  11. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/aggregation/aggregation.py +0 -0
  12. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/aggregation/df_types.py +0 -0
  13. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/aggregation/mysql_types.py +0 -0
  14. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/aggregation/optimize_data.py +0 -0
  15. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/aggregation/query_data.py +0 -0
  16. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/bdup/__init__.py +0 -0
  17. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/bdup/bdup.py +0 -0
  18. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/clean/__init__.py +0 -0
  19. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/clean/data_clean.py +0 -0
  20. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/company/__init__.py +0 -0
  21. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/company/copysh_bak.py +0 -0
  22. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/company/home_sh.py +0 -0
  23. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/config/__init__.py +0 -0
  24. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/config/get_myconf.py +0 -0
  25. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/config/myconfig.py +0 -0
  26. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/config/products.py +0 -0
  27. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/config/set_support.py +0 -0
  28. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/config/update_conf.py +0 -0
  29. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/dataframe/__init__.py +0 -0
  30. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/dataframe/converter.py +0 -0
  31. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/log/__init__.py +0 -0
  32. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/log/mylogger.py +0 -0
  33. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/mongo/__init__.py +0 -0
  34. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/mongo/mongo.py +0 -0
  35. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/mysql/__init__.py +0 -0
  36. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/mysql/mysql.py +0 -0
  37. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/mysql/recheck_mysql.py +0 -0
  38. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/mysql/s_query.py +0 -0
  39. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/mysql/year_month_day.py +0 -0
  40. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/other/__init__.py +0 -0
  41. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/other/porxy.py +0 -0
  42. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/other/pov_city.py +0 -0
  43. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/other/sku_picture.py +0 -0
  44. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/other/ua_sj.py +0 -0
  45. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/pbix/__init__.py +0 -0
  46. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/pbix/pbix_refresh.py +0 -0
  47. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/pbix/refresh_all_old.py +0 -0
  48. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/req_post/__init__.py +0 -0
  49. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/req_post/req_tb.py +0 -0
  50. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/spider/__init__.py +0 -0
  51. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq/spider/aikucun.py +0 -0
  52. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq.egg-info/SOURCES.txt +0 -0
  53. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq.egg-info/dependency_links.txt +0 -0
  54. {mdbq-2.8.2 → mdbq-2.8.4}/mdbq.egg-info/top_level.txt +0 -0
  55. {mdbq-2.8.2 → mdbq-2.8.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mdbq
3
- Version: 2.8.2
3
+ Version: 2.8.4
4
4
  Home-page: https://pypi.org/project/mdbq
5
5
  Author: xigua,
6
6
  Author-email: 2587125111@qq.com
@@ -832,6 +832,8 @@ class DataClean:
832
832
  # df = pd.read_excel(os.path.join(root, name), header=0, engine='openpyxl')
833
833
  df = pd.read_csv(os.path.join(root, name), encoding='utf-8_sig', header=0, na_filter=False)
834
834
  new_name = f'py_xg_{name}'
835
+ if os.path.isfile(os.path.join(root, new_name)):
836
+ os.remove(os.path.join(root, new_name))
835
837
  os.rename(os.path.join(root, name), os.path.join(root, new_name))
836
838
  elif name.endswith('.xlsx') and '京东商智_sku_商品明细' in name:
837
839
  df = pd.read_excel(os.path.join(root, name), header=0, engine='openpyxl')
@@ -950,6 +952,8 @@ class DataClean:
950
952
  elif name.endswith('.csv') and ('商品类目属性' in name or '商品主图视频' in name or '商品sku属性' in name):
951
953
  df = pd.read_csv(os.path.join(root, name), encoding='utf-8_sig', header=0, na_filter=False)
952
954
  new_name = f'py_xg_{os.path.splitext(name)[0]}.csv'
955
+ if os.path.isfile(os.path.join(root, new_name)):
956
+ os.remove(os.path.join(root, new_name))
953
957
  os.rename(os.path.join(root, name), os.path.join(root, new_name))
954
958
 
955
959
  # 将数据传入 self.datas 等待更新进数据库
@@ -1585,7 +1589,7 @@ def main(is_mysql=False, is_company=False):
1585
1589
  # 清理聚合数据, mongodb 中没有聚合数据,所以只需要清理 mysql 即可
1586
1590
  optimize_data.op_data(
1587
1591
  db_name_lists=['聚合数据'],
1588
- days=3650,
1592
+ days=100,
1589
1593
  is_mongo=False,
1590
1594
  is_mysql=True,
1591
1595
  )
@@ -16,13 +16,13 @@ from mdbq.aggregation import optimize_data
16
16
  from mdbq.config import set_support
17
17
  from mdbq.config import myconfig
18
18
  from mdbq.mysql import mysql
19
- from mdbq.pbix import refresh_all
20
19
  from mdbq.clean import clean_upload
21
20
  warnings.filterwarnings('ignore')
22
21
 
23
22
 
24
23
  if platform.system() == 'Windows':
25
24
  # windows版本
25
+ from mdbq.pbix import refresh_all
26
26
  Data_Path = r'C:\同步空间\BaiduSyncdisk'
27
27
  D_PATH = os.path.join(f'C:\\Users\\{getpass.getuser()}\\Downloads')
28
28
  Share_Path = os.path.join(r'\\192.168.1.198\时尚事业部\01.运营部\天猫报表') # 共享文件根目录
@@ -275,25 +275,26 @@ class TbFiles:
275
275
  print(f'{src} 所需同步的文件不存在,请检查:pd_list参数')
276
276
 
277
277
  # 刷新共享位置的指定文件/文件夹
278
- excel_path = os.path.join(self.share_path, 'EXCEL报表')
279
- files = os.listdir(excel_path)
280
- files = [f'{excel_path}\\{item}' for item in files if item.endswith('.xlsx') or item.endswith('.xls')]
281
- r = refresh_all.RefreshAll()
282
- for file in files:
283
- if '~' in file or 'DS_Store' in file or 'baidu' in file or 'xunlei' in file:
284
- continue
285
- if file.endswith('.xlsx') or file.endswith('.xls'):
286
- r.refresh_excel(file=file)
287
- time.sleep(5)
288
-
289
- # 临时加的
290
- # excel_file = f'\\\\192.168.1.198\\时尚事业部\\01.运营部\\0-电商周报-每周五更新\\0-WLM_运营周报-1012输出.xlsx'
291
- dir_files = f'\\\\192.168.1.198\\时尚事业部\\01.运营部\\0-电商周报-每周五更新'
292
- files = os.listdir(dir_files)
293
- for file in files:
294
- if file.endswith('.xlsx') and file.startswith('0-WLM_运营周报') and '~' not in file and 'baidu' not in file:
295
- excel_file = os.path.join(dir_files, file)
296
- r.refresh_excel(file=excel_file)
278
+ if platform.system() == 'Windows':
279
+ excel_path = os.path.join(self.share_path, 'EXCEL报表')
280
+ files = os.listdir(excel_path)
281
+ files = [f'{excel_path}\\{item}' for item in files if item.endswith('.xlsx') or item.endswith('.xls')]
282
+ r = refresh_all.RefreshAll()
283
+ for file in files:
284
+ if '~' in file or 'DS_Store' in file or 'baidu' in file or 'xunlei' in file:
285
+ continue
286
+ if file.endswith('.xlsx') or file.endswith('.xls'):
287
+ r.refresh_excel(file=file)
288
+ time.sleep(5)
289
+
290
+ # 临时加的
291
+ # excel_file = f'\\\\192.168.1.198\\时尚事业部\\01.运营部\\0-电商周报-每周五更新\\0-WLM_运营周报-1012输出.xlsx'
292
+ dir_files = f'\\\\192.168.1.198\\时尚事业部\\01.运营部\\0-电商周报-每周五更新'
293
+ files = os.listdir(dir_files)
294
+ for file in files:
295
+ if file.endswith('.xlsx') and file.startswith('0-WLM_运营周报') and '~' not in file and 'baidu' not in file:
296
+ excel_file = os.path.join(dir_files, file)
297
+ r.refresh_excel(file=excel_file)
297
298
 
298
299
  self.before_max_time = self.check_change() # 重置值, 避免重复同步
299
300
 
@@ -339,9 +340,9 @@ def op_data(days: int =100):
339
340
 
340
341
 
341
342
  def main():
342
- if platform.system() != 'Windows':
343
- print(f'只可以在 windows 运行')
344
- return
343
+ # if platform.system() != 'Windows':
344
+ # print(f'只可以在 windows 运行')
345
+ # return
345
346
  t = TbFiles()
346
347
  while True:
347
348
  system = platform.system() # 本机系统
@@ -357,7 +358,7 @@ def main():
357
358
  b.download_dir(local_path=upload_path, remote_path=bd_remoto_path)
358
359
 
359
360
  clean_upload.main(
360
- is_mysql=True, # 调试时加,False: 是否后续的聚合数据及清理
361
+ is_mysql=True, # 调试时加,False: 不进行后续的聚合数据及清理
361
362
  is_company=True, # 公司电脑不需要移动文件到原始文件
362
363
  )
363
364
 
@@ -1,6 +1,5 @@
1
1
  import os
2
2
  import sys
3
- import win32com.client
4
3
  import time
5
4
  import psutil
6
5
  from pywinauto.application import Application
@@ -51,6 +50,7 @@ class RefreshAll:
51
50
 
52
51
  def refresh_excel(self, file):
53
52
  # 刷新 excel
53
+ import win32com.client
54
54
  if not os.path.isfile(file):
55
55
  now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S ')
56
56
  print(f'{now}{file} -> 文件不存在')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mdbq
3
- Version: 2.8.2
3
+ Version: 2.8.4
4
4
  Home-page: https://pypi.org/project/mdbq
5
5
  Author: xigua,
6
6
  Author-email: 2587125111@qq.com
@@ -3,7 +3,7 @@
3
3
  from setuptools import setup, find_packages
4
4
 
5
5
  setup(name='mdbq',
6
- version='2.8.2',
6
+ version='2.8.4',
7
7
  author='xigua, ',
8
8
  author_email="2587125111@qq.com",
9
9
  url='https://pypi.org/project/mdbq',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes