mdbq 3.4.7__py3-none-any.whl → 3.4.9__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.
- mdbq/aggregation/query_data.py +17 -20
- mdbq/other/download_sku_picture.py +0 -5
- {mdbq-3.4.7.dist-info → mdbq-3.4.9.dist-info}/METADATA +1 -1
- {mdbq-3.4.7.dist-info → mdbq-3.4.9.dist-info}/RECORD +6 -6
- {mdbq-3.4.7.dist-info → mdbq-3.4.9.dist-info}/WHEEL +0 -0
- {mdbq-3.4.7.dist-info → mdbq-3.4.9.dist-info}/top_level.txt +0 -0
mdbq/aggregation/query_data.py
CHANGED
@@ -3850,7 +3850,8 @@ def main(days=150, months=3):
|
|
3850
3850
|
'市场数据3',
|
3851
3851
|
]
|
3852
3852
|
# 使用 ThreadPoolExecutor 来并行运行
|
3853
|
-
with concurrent.futures.ThreadPoolExecutor() as executor:
|
3853
|
+
# with concurrent.futures.ThreadPoolExecutor() as executor:
|
3854
|
+
with concurrent.futures.ProcessPoolExecutor() as executor:
|
3854
3855
|
for step in range(len(db_list)):
|
3855
3856
|
future_to_function = {
|
3856
3857
|
executor.submit(
|
@@ -3868,7 +3869,8 @@ def main(days=150, months=3):
|
|
3868
3869
|
# 2. 数据聚合
|
3869
3870
|
query_list = [query1, query2, query3]
|
3870
3871
|
# 使用 ThreadPoolExecutor 来并行运行
|
3871
|
-
with concurrent.futures.ThreadPoolExecutor() as executor:
|
3872
|
+
# with concurrent.futures.ThreadPoolExecutor() as executor:
|
3873
|
+
with concurrent.futures.ProcessPoolExecutor() as executor:
|
3872
3874
|
for func_query in query_list:
|
3873
3875
|
future_to_function = {
|
3874
3876
|
executor.submit(
|
@@ -3890,14 +3892,15 @@ def main(days=150, months=3):
|
|
3890
3892
|
|
3891
3893
|
|
3892
3894
|
if __name__ == '__main__':
|
3893
|
-
main(
|
3894
|
-
|
3895
|
-
|
3896
|
-
)
|
3895
|
+
# main(
|
3896
|
+
# days=3, # 清理聚合数据的日期长度
|
3897
|
+
# months=1 # 生成聚合数据的长度
|
3898
|
+
# )
|
3897
3899
|
|
3898
|
-
# query_list = [query1, query2]
|
3900
|
+
# query_list = [query1, query2, query3]
|
3899
3901
|
# # 使用 ThreadPoolExecutor 来并行运行
|
3900
|
-
# with concurrent.futures.ThreadPoolExecutor() as executor:
|
3902
|
+
# # with concurrent.futures.ThreadPoolExecutor() as executor:
|
3903
|
+
# with concurrent.futures.ProcessPoolExecutor() as executor:
|
3901
3904
|
# for func_query in query_list:
|
3902
3905
|
# future_to_function = {
|
3903
3906
|
# executor.submit(
|
@@ -3907,17 +3910,11 @@ if __name__ == '__main__':
|
|
3907
3910
|
# ),
|
3908
3911
|
# }
|
3909
3912
|
|
3910
|
-
|
3911
|
-
|
3912
|
-
|
3913
|
-
|
3914
|
-
|
3915
|
-
|
3916
|
-
# )
|
3913
|
+
optimize_data.op_data(
|
3914
|
+
db_name_lists=['聚合数据'],
|
3915
|
+
days=60, # 清理聚合数据的日期长度
|
3916
|
+
is_mongo=False,
|
3917
|
+
is_mysql=True,
|
3918
|
+
)
|
3917
3919
|
|
3918
|
-
# query3(months=2, less_dict=[])
|
3919
3920
|
|
3920
|
-
# sdq = MysqlDatasQuery() # 实例化数据处理类
|
3921
|
-
# sdq.months = 1 # 设置数据周期, 1 表示近 2 个月
|
3922
|
-
# sdq.update_service = True # 调试时加,true: 将数据写入 mysql 服务器
|
3923
|
-
# sdq.item_up()
|
@@ -19,7 +19,6 @@ from selenium.webdriver.common.by import By
|
|
19
19
|
from selenium.webdriver.support import expected_conditions as EC
|
20
20
|
from selenium.webdriver.chrome.service import Service
|
21
21
|
from mdbq.config import set_support
|
22
|
-
from mdbq.config import get_myconf
|
23
22
|
from mdbq.config import myconfig
|
24
23
|
from mdbq.mysql import mysql
|
25
24
|
from mdbq.mysql import s_query
|
@@ -816,7 +815,6 @@ def main(service_name, database):
|
|
816
815
|
tb_driver2.quit()
|
817
816
|
|
818
817
|
# s.df.to_csv('/Users/xigua/Downloads/test.csv', encoding='utf-8_sig', index=False, header=True)
|
819
|
-
username, password, host, port = get_myconf.select_config_values(target_service=service_name, database=database)
|
820
818
|
m = mysql.MysqlUpload(username=username, password=password, host=host, port=port)
|
821
819
|
m.df_to_mysql(
|
822
820
|
df=s.df,
|
@@ -854,7 +852,6 @@ def main3():
|
|
854
852
|
def download_sku(service_name='company', database='mysql', db_name='属性设置2', table_name='商品素材下载记录', col_name='sku图片链接'):
|
855
853
|
""" 从数据库中获取商品id信息 """
|
856
854
|
# 实例化一个下载类
|
857
|
-
username, password, host, port = get_myconf.select_config_values(target_service=service_name, database=database)
|
858
855
|
download = s_query.QueryDatas(username=username, password=password, host=host, port=port)
|
859
856
|
projection = {
|
860
857
|
'宝贝id': 1,
|
@@ -898,7 +895,6 @@ def download_sku(service_name='company', database='mysql', db_name='属性设置
|
|
898
895
|
tb_driver2.quit()
|
899
896
|
|
900
897
|
# 回传数据库
|
901
|
-
username, password, host, port = get_myconf.select_config_values(target_service=service_name, database=database)
|
902
898
|
m = mysql.MysqlUpload(username=username, password=password, host=host, port=port)
|
903
899
|
m.df_to_mysql(
|
904
900
|
df=s.df,
|
@@ -939,7 +935,6 @@ def download_sku(service_name='company', database='mysql', db_name='属性设置
|
|
939
935
|
df['获取与下载'] = df.apply(lambda x: '已下载' if x['sku编码'] in d.finish_download else x['获取与下载'], axis=1)
|
940
936
|
|
941
937
|
# 回传数据库
|
942
|
-
username, password, host, port = get_myconf.select_config_values(target_service=service_name, database=database)
|
943
938
|
m = mysql.MysqlUpload(username=username, password=password, host=host, port=port)
|
944
939
|
m.df_to_mysql(
|
945
940
|
df=df,
|
@@ -4,7 +4,7 @@ mdbq/aggregation/__init__.py,sha256=EeDqX2Aml6SPx8363J-v1lz0EcZtgwIBYyCJV6CcEDU,
|
|
4
4
|
mdbq/aggregation/aggregation.py,sha256=-yzApnlqSN2L0E1YMu5ml-W827qpKQvWPCOI7jj2kzY,80264
|
5
5
|
mdbq/aggregation/datashow.py,sha256=1AYSIDkdUx-4as1Ax2rPj0cExM9d-qFMrFYLAaPHNuk,54962
|
6
6
|
mdbq/aggregation/optimize_data.py,sha256=RXIv7cACCgYyehAxMjUYi_S7rVyjIwXKWMaM3nduGtA,3068
|
7
|
-
mdbq/aggregation/query_data.py,sha256=
|
7
|
+
mdbq/aggregation/query_data.py,sha256=By7tPjrGuVyEuRwTmTdhkwU7s8U6-r_BoH3eXypRZ9I,178800
|
8
8
|
mdbq/bdup/__init__.py,sha256=AkhsGk81SkG1c8FqDH5tRq-8MZmFobVbN60DTyukYTY,28
|
9
9
|
mdbq/bdup/bdup.py,sha256=LAV0TgnQpc-LB-YuJthxb0U42_VkPidzQzAagan46lU,4234
|
10
10
|
mdbq/config/__init__.py,sha256=jso1oHcy6cJEfa7udS_9uO5X6kZLoPBF8l3wCYmr5dM,18
|
@@ -23,7 +23,7 @@ mdbq/mysql/recheck_mysql.py,sha256=ppBTfBLgkRWirMVZ31e_ZPULiGPJU7K3PP9G6QBZ3QI,8
|
|
23
23
|
mdbq/mysql/s_query.py,sha256=6L5Cp90zq13noZHjzSA5mqms_hD01c8GO1_NfbYDu6w,9252
|
24
24
|
mdbq/mysql/year_month_day.py,sha256=VgewoE2pJxK7ErjfviL_SMTN77ki8GVbTUcao3vFUCE,1523
|
25
25
|
mdbq/other/__init__.py,sha256=jso1oHcy6cJEfa7udS_9uO5X6kZLoPBF8l3wCYmr5dM,18
|
26
|
-
mdbq/other/download_sku_picture.py,sha256=
|
26
|
+
mdbq/other/download_sku_picture.py,sha256=GdphR7Q3psXXVuZoyJ4u_6OWn_rWlcbT0iJ-1zPT6O0,45368
|
27
27
|
mdbq/other/porxy.py,sha256=UHfgEyXugogvXgsG68a7QouUCKaohTKKkI4RN-kYSdQ,4961
|
28
28
|
mdbq/other/pov_city.py,sha256=AEOmCOzOwyjHi9LLZWPKi6DUuSC-_M163664I52u9qw,21050
|
29
29
|
mdbq/other/sku_picture.py,sha256=JwSXYlzamVqcKCD2tRH2VqYVZNr8fM6f--kcGlTVRnM,50026
|
@@ -34,7 +34,7 @@ mdbq/pbix/refresh_all.py,sha256=OBT9EewSZ0aRS9vL_FflVn74d4l2G00wzHiikCC4TC0,5926
|
|
34
34
|
mdbq/pbix/refresh_all_old.py,sha256=_pq3WSQ728GPtEG5pfsZI2uTJhU8D6ra-htIk1JXYzw,7192
|
35
35
|
mdbq/spider/__init__.py,sha256=RBMFXGy_jd1HXZhngB2T2XTvJqki8P_Fr-pBcwijnew,18
|
36
36
|
mdbq/spider/aikucun.py,sha256=zOacjrJ3MvToyuugA68xB-oN6RKj8K3GxMKudnln9EA,22207
|
37
|
-
mdbq-3.4.
|
38
|
-
mdbq-3.4.
|
39
|
-
mdbq-3.4.
|
40
|
-
mdbq-3.4.
|
37
|
+
mdbq-3.4.9.dist-info/METADATA,sha256=duoMMqXV3SgW8V-H5OZezxNbrEznsg6U0_CZdcVIGUo,243
|
38
|
+
mdbq-3.4.9.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
39
|
+
mdbq-3.4.9.dist-info/top_level.txt,sha256=2FQ-uLnCSB-OwFiWntzmwosW3X2Xqsg0ewh1axsaylA,5
|
40
|
+
mdbq-3.4.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|