mdbq 3.6.21__tar.gz → 3.6.23__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 (46) hide show
  1. {mdbq-3.6.21 → mdbq-3.6.23}/PKG-INFO +1 -1
  2. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/config/default.py +26 -0
  3. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/config/set_support.py +3 -3
  4. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/spider/aikucun.py +0 -10
  5. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq.egg-info/PKG-INFO +1 -1
  6. {mdbq-3.6.21 → mdbq-3.6.23}/setup.py +1 -1
  7. {mdbq-3.6.21 → mdbq-3.6.23}/README.txt +0 -0
  8. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/__init__.py +0 -0
  9. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/__version__.py +0 -0
  10. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/aggregation/__init__.py +0 -0
  11. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/aggregation/aggregation_bak.py +0 -0
  12. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/aggregation/datashow_bak.py +0 -0
  13. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/aggregation/optimize_data.py +0 -0
  14. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/aggregation/query_data.py +0 -0
  15. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/bdup/__init__.py +0 -0
  16. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/bdup/bdup.py +0 -0
  17. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/config/__init__.py +0 -0
  18. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/config/myconfig.py +0 -0
  19. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/config/products.py +0 -0
  20. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/dataframe/__init__.py +0 -0
  21. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/dataframe/converter.py +0 -0
  22. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/log/__init__.py +0 -0
  23. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/log/mylogger.py +0 -0
  24. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/mongo/__init__.py +0 -0
  25. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/mongo/mongo.py +0 -0
  26. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/mysql/__init__.py +0 -0
  27. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/mysql/mysql.py +0 -0
  28. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/mysql/s_query.py +0 -0
  29. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/mysql/year_month_day.py +0 -0
  30. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/other/__init__.py +0 -0
  31. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/other/download_sku_picture.py +0 -0
  32. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/other/porxy.py +0 -0
  33. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/other/pov_city.py +0 -0
  34. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/other/sku_picture.py +0 -0
  35. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/other/ua_sj.py +0 -0
  36. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/pbix/__init__.py +0 -0
  37. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/pbix/pbix_refresh.py +0 -0
  38. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/pbix/refresh_all.py +0 -0
  39. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/pbix/refresh_all_old.py +0 -0
  40. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/redis/__init__.py +0 -0
  41. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/redis/getredis.py +0 -0
  42. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq/spider/__init__.py +0 -0
  43. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq.egg-info/SOURCES.txt +0 -0
  44. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq.egg-info/dependency_links.txt +0 -0
  45. {mdbq-3.6.21 → mdbq-3.6.23}/mdbq.egg-info/top_level.txt +0 -0
  46. {mdbq-3.6.21 → mdbq-3.6.23}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mdbq
3
- Version: 3.6.21
3
+ Version: 3.6.23
4
4
  Home-page: https://pypi.org/project/mdbq
5
5
  Author: xigua,
6
6
  Author-email: 2587125111@qq.com
@@ -16,6 +16,19 @@ else:
16
16
  logger = logging.getLogger(__name__)
17
17
 
18
18
 
19
+ def get_mysql_engine(platform, hostname, sql, local, config_file=None):
20
+ if not config_file:
21
+ config_file = os.path.join(support_path, 'my_config.txt')
22
+ if not os.path.isfile(config_file):
23
+ print(f'缺少配置文件,无法读取配置文件: {config_file}')
24
+ return None
25
+ with open(config_file, 'r', encoding='utf-8') as f:
26
+ conf = json.load(f)
27
+ conf_data = conf[platform][hostname][sql][local]
28
+ username, password, host, port = conf_data['username'], conf_data['password'], conf_data['host'], conf_data['port']
29
+ return mysql.MysqlUpload(username=username, password=password, host=host, port=port, charset='utf8mb4')
30
+
31
+
19
32
  def return_host(conf_data):
20
33
  """
21
34
  从配置文件数据中获取: username, password, host, port
@@ -95,3 +108,16 @@ def write_back(datas):
95
108
 
96
109
  if __name__ == '__main__':
97
110
  pass
111
+ username, password, host, port = get_hostname(
112
+ platform='Windows',
113
+ hostname='xigua_lx',
114
+ sql='mysql',
115
+ local='remoto'
116
+ )
117
+ res = get_mysql_engine(
118
+ platform='Windows',
119
+ hostname='xigua_lx',
120
+ sql='mysql',
121
+ local='remoto'
122
+ )
123
+ print(res)
@@ -10,11 +10,11 @@ class SetSupport:
10
10
  def __init__(self, dirname):
11
11
  self.dirname = dirname
12
12
  if platform.system() == 'Windows':
13
- self.dirname = f'C:\\同步空间\\BaiduSyncdisk\\自动0备份\\py\\数据更新\\support'
13
+ self.dirname = f'C:\\数据中心2\\support'
14
14
  elif platform.system() == 'Darwin':
15
- self.dirname = f'/Users/{getpass.getuser()}/数据中心/自动0备份/py/数据更新/support'
15
+ self.dirname = f'/Users/{getpass.getuser()}/数据中心2/support'
16
16
  else:
17
- self.dirname = '数据中心/数据更新/support' # 没有用可以删
17
+ self.dirname = '数据中心2/support' # 没有用, 可以删
18
18
 
19
19
 
20
20
  if __name__ == '__main__':
@@ -27,23 +27,13 @@ warnings.filterwarnings('ignore')
27
27
 
28
28
  if platform.system() == 'Windows':
29
29
  # windows版本
30
- Data_Path = r'C:\同步空间\BaiduSyncdisk'
31
30
  D_PATH = str(pathlib.Path(f'C:\\Users\\{getpass.getuser()}\\Downloads'))
32
- Share_Path = str(pathlib.Path(r'\\192.168.1.198\时尚事业部\01.运营部\天猫报表')) # 共享文件根目录
33
- Source_Path = str(pathlib.Path(Data_Path, '原始文件2'))
34
31
  elif platform.system() == 'Linux':
35
- Data_Path = '数据中心'
36
32
  D_PATH = 'Downloads'
37
33
  if not os.path.exists(D_PATH):
38
34
  os.makedirs(D_PATH)
39
- Share_Path = '' # linux 通常是远程服务器,不需要访问共享
40
- Source_Path = str(pathlib.Path(Data_Path, '原始文件2'))
41
35
  else:
42
- Data_Path = f'/Users/{getpass.getuser()}/数据中心' # 使用Mac独立网络时
43
- # Data_Path = '/Volumes' # 直接使用共享连接台式机时的配置, 后面接 + 自动0备份/***
44
36
  D_PATH = str(pathlib.Path(f'/Users/{getpass.getuser()}/Downloads'))
45
- Share_Path = str(pathlib.Path('/Volumes/时尚事业部/01.运营部/天猫报表')) # 共享文件根目录
46
- Source_Path = str(pathlib.Path(Data_Path, '原始文件2'))
47
37
  upload_path = os.path.join(D_PATH, '数据上传中心', '爱库存') # 此目录位于下载文件夹
48
38
 
49
39
  m_engine, company_engine, ts_engine, (username, password, host, port) = default.get_engine()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mdbq
3
- Version: 3.6.21
3
+ Version: 3.6.23
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='3.6.21',
6
+ version='3.6.23',
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