mdbq 2.0.5__tar.gz → 2.0.6__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-2.0.5 → mdbq-2.0.6}/PKG-INFO +1 -1
  2. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/aggregation/optimize_data.py +34 -31
  3. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq.egg-info/PKG-INFO +1 -1
  4. {mdbq-2.0.5 → mdbq-2.0.6}/setup.py +1 -1
  5. {mdbq-2.0.5 → mdbq-2.0.6}/README.txt +0 -0
  6. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/__init__.py +0 -0
  7. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/__version__.py +0 -0
  8. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/aggregation/__init__.py +0 -0
  9. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/aggregation/aggregation.py +0 -0
  10. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/aggregation/df_types.py +0 -0
  11. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/aggregation/mysql_types.py +0 -0
  12. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/aggregation/query_data.py +0 -0
  13. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/bdup/__init__.py +0 -0
  14. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/bdup/bdup.py +0 -0
  15. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/clean/__init__.py +0 -0
  16. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/clean/data_clean.py +0 -0
  17. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/company/__init__.py +0 -0
  18. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/company/copysh.py +0 -0
  19. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/config/__init__.py +0 -0
  20. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/config/get_myconf.py +0 -0
  21. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/config/products.py +0 -0
  22. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/config/set_support.py +0 -0
  23. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/config/update_conf.py +0 -0
  24. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/dataframe/__init__.py +0 -0
  25. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/dataframe/converter.py +0 -0
  26. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/log/__init__.py +0 -0
  27. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/log/mylogger.py +0 -0
  28. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/mongo/__init__.py +0 -0
  29. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/mongo/mongo.py +0 -0
  30. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/mysql/__init__.py +0 -0
  31. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/mysql/mysql.py +0 -0
  32. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/mysql/s_query.py +0 -0
  33. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/mysql/year_month_day.py +0 -0
  34. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/other/__init__.py +0 -0
  35. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/other/porxy.py +0 -0
  36. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/other/pov_city.py +0 -0
  37. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/other/sku_picture.py +0 -0
  38. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/other/ua_sj.py +0 -0
  39. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/pbix/__init__.py +0 -0
  40. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/pbix/pbix_refresh.py +0 -0
  41. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/pbix/refresh_all.py +0 -0
  42. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq/spider/__init__.py +0 -0
  43. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq.egg-info/SOURCES.txt +0 -0
  44. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq.egg-info/dependency_links.txt +0 -0
  45. {mdbq-2.0.5 → mdbq-2.0.6}/mdbq.egg-info/top_level.txt +0 -0
  46. {mdbq-2.0.5 → mdbq-2.0.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mdbq
3
- Version: 2.0.5
3
+ Version: 2.0.6
4
4
  Home-page: https://pypi.org/project/mdbsql
5
5
  Author: xigua,
6
6
  Author-email: 2587125111@qq.com
@@ -57,7 +57,7 @@ def restart_mongodb():
57
57
  subprocess.call(command, shell=True)
58
58
 
59
59
 
60
- def op_data(db_name_lists, service_databases=None, days: int = 63):
60
+ def op_data(db_name_lists, service_databases=None, days: int = 63, is_mongo=True, is_mysql=True):
61
61
  """ service_databases 这个参数暂时没有用 """
62
62
  # for service_database in service_databases:
63
63
  # for service_name, database in service_database.items():
@@ -71,42 +71,45 @@ def op_data(db_name_lists, service_databases=None, days: int = 63):
71
71
 
72
72
  if socket.gethostname() == 'xigua_lx' or socket.gethostname() == 'xigua1' or socket.gethostname() == 'Mac2.local':
73
73
  # mongodb
74
- username, password, host, port = get_myconf.select_config_values(
75
- target_service='home_lx',
76
- database='mongodb',
77
- )
78
- m = mongo.OptimizeDatas(username=username, password=password, host=host, port=port)
79
- m.db_name_lists = db_name_lists
80
- m.days = days
81
- m.optimize_list()
82
- if m.client:
83
- m.client.close()
84
- print(f'已关闭 mongodb 连接')
74
+ if is_mongo:
75
+ username, password, host, port = get_myconf.select_config_values(
76
+ target_service='home_lx',
77
+ database='mongodb',
78
+ )
79
+ m = mongo.OptimizeDatas(username=username, password=password, host=host, port=port)
80
+ m.db_name_lists = db_name_lists
81
+ m.days = days
82
+ m.optimize_list()
83
+ if m.client:
84
+ m.client.close()
85
+ print(f'已关闭 mongodb 连接')
85
86
 
86
- if socket.gethostname() == 'xigua_lx':
87
- restart_mongodb() # mongodb 太占内存了, 重启服务, 释放内存
87
+ if socket.gethostname() == 'xigua_lx':
88
+ restart_mongodb() # mongodb 太占内存了, 重启服务, 释放内存
88
89
 
89
90
  # Mysql
90
- username, password, host, port = get_myconf.select_config_values(
91
- target_service='home_lx',
92
- database='mysql',
93
- )
94
- s = mysql.OptimizeDatas(username=username, password=password, host=host, port=port)
95
- s.db_name_lists = db_name_lists
96
- s.days = days
97
- s.optimize_list()
91
+ if is_mysql:
92
+ username, password, host, port = get_myconf.select_config_values(
93
+ target_service='home_lx',
94
+ database='mysql',
95
+ )
96
+ s = mysql.OptimizeDatas(username=username, password=password, host=host, port=port)
97
+ s.db_name_lists = db_name_lists
98
+ s.days = days
99
+ s.optimize_list()
98
100
 
99
101
  elif socket.gethostname() == 'company':
100
102
  # Mysql
101
- username, password, host, port = get_myconf.select_config_values(
102
- target_service='company',
103
- database='mysql',
104
- )
105
- s = mysql.OptimizeDatas(username=username, password=password, host=host, port=port)
106
- s.db_name_lists = db_name_lists
107
- s.days = days
108
- s.optimize_list()
103
+ if is_mysql:
104
+ username, password, host, port = get_myconf.select_config_values(
105
+ target_service='company',
106
+ database='mysql',
107
+ )
108
+ s = mysql.OptimizeDatas(username=username, password=password, host=host, port=port)
109
+ s.db_name_lists = db_name_lists
110
+ s.days = days
111
+ s.optimize_list()
109
112
 
110
113
 
111
114
  if __name__ == '__main__':
112
- op_data(db_name_lists=['聚合数据'], service_databases=[{'company': 'mysql'}], days=3650)
115
+ op_data(db_name_lists=['聚合数据'], service_databases=[{'company': 'mysql'}], days=3650, is_mongo=True, is_mysql=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mdbq
3
- Version: 2.0.5
3
+ Version: 2.0.6
4
4
  Home-page: https://pypi.org/project/mdbsql
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.0.5',
6
+ version='2.0.6',
7
7
  author='xigua, ',
8
8
  author_email="2587125111@qq.com",
9
9
  url='https://pypi.org/project/mdbsql',
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