mdbq 2.5.9__py3-none-any.whl → 2.6.1__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/aggregation.py +11 -10
- mdbq/aggregation/query_data.py +1 -1
- mdbq/clean/clean_upload.py +15 -14
- mdbq/mysql/mysql.py +1 -1
- {mdbq-2.5.9.dist-info → mdbq-2.6.1.dist-info}/METADATA +1 -1
- {mdbq-2.5.9.dist-info → mdbq-2.6.1.dist-info}/RECORD +8 -8
- {mdbq-2.5.9.dist-info → mdbq-2.6.1.dist-info}/WHEEL +0 -0
- {mdbq-2.5.9.dist-info → mdbq-2.6.1.dist-info}/top_level.txt +0 -0
mdbq/aggregation/aggregation.py
CHANGED
@@ -1301,7 +1301,7 @@ def test2():
|
|
1301
1301
|
if __name__ == '__main__':
|
1302
1302
|
username, password, host, port = get_myconf.select_config_values(target_service='nas', database='mysql')
|
1303
1303
|
print(username, password, host, port)
|
1304
|
-
file_dir(one_file=False, target_service='company')
|
1304
|
+
# file_dir(one_file=False, target_service='company')
|
1305
1305
|
# one_file_to_mysql(
|
1306
1306
|
# file='/Users/xigua/Downloads/爱库存_商品榜单_spu_2024-10-17_2024-10-17.csv',
|
1307
1307
|
# db_name='爱库存2',
|
@@ -1310,15 +1310,16 @@ if __name__ == '__main__':
|
|
1310
1310
|
# database='mysql'
|
1311
1311
|
# )
|
1312
1312
|
|
1313
|
-
#
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1313
|
+
# 上传一个目录到指定数据库
|
1314
|
+
db_name = '天猫_推广数据3'
|
1315
|
+
table_name = '主体报表'
|
1316
|
+
upload_dir(
|
1317
|
+
path='/Users/xigua/数据中心/原始文件3/天猫推广报表/主体报表',
|
1318
|
+
db_name=db_name,
|
1319
|
+
collection_name=table_name,
|
1320
|
+
dbs={'mysql': True, 'mongodb': False},
|
1321
|
+
target_service='company',
|
1322
|
+
)
|
1322
1323
|
|
1323
1324
|
|
1324
1325
|
# # 新版 数据分类
|
mdbq/aggregation/query_data.py
CHANGED
mdbq/clean/clean_upload.py
CHANGED
@@ -90,12 +90,12 @@ class DataClean:
|
|
90
90
|
report_names = [
|
91
91
|
{
|
92
92
|
'文件简称': '商品排行', # 文件名中包含的字符
|
93
|
-
'数据库名': '天猫_生意参谋',
|
93
|
+
'数据库名': '天猫_生意参谋3',
|
94
94
|
'集合名称': '商品排行',
|
95
95
|
},
|
96
96
|
{
|
97
97
|
'文件简称': '店铺来源_来源构成_万里马官方旗舰店', # 文件名中包含的字符
|
98
|
-
'数据库名': '天猫_生意参谋',
|
98
|
+
'数据库名': '天猫_生意参谋3',
|
99
99
|
'集合名称': '店铺流量来源构成',
|
100
100
|
},
|
101
101
|
]
|
@@ -1366,6 +1366,7 @@ def main(service_databases=None, is_mysql=False):
|
|
1366
1366
|
cn.dmp_tm(is_except=['except']) # 达摩盘
|
1367
1367
|
cn.tg_reports(is_except=['except']) # 推广报表,天猫淘宝共同清洗
|
1368
1368
|
cn.syj_reports_tm(is_except=['except']) # 天猫生意经
|
1369
|
+
# # 淘宝生意经,不可以和天猫同时运行
|
1369
1370
|
# cn.syj_reports_tb(is_except=['except']) # 淘宝生意经,不可以和天猫同时运行
|
1370
1371
|
cn.jd_reports(is_except=['except']) # 清洗京东报表
|
1371
1372
|
cn.sp_scene_clean(is_except=['except']) # 商品素材
|
@@ -1399,7 +1400,7 @@ def main(service_databases=None, is_mysql=False):
|
|
1399
1400
|
'天猫_推广数据3',
|
1400
1401
|
'淘宝_推广数据3',
|
1401
1402
|
# '市场数据3',
|
1402
|
-
|
1403
|
+
'天猫_生意参谋3',
|
1403
1404
|
'天猫_生意经3',
|
1404
1405
|
# '淘宝_生意经3',
|
1405
1406
|
],
|
@@ -1425,25 +1426,25 @@ def main(service_databases=None, is_mysql=False):
|
|
1425
1426
|
|
1426
1427
|
def test():
|
1427
1428
|
# main_key = '单元报表'
|
1428
|
-
path = f'/Users/xigua/数据中心/原始文件
|
1429
|
+
path = f'/Users/xigua/数据中心/原始文件3/天猫推广报表/主体报表'
|
1429
1430
|
for root, dirs, files in os.walk(path, topdown=False):
|
1430
1431
|
for name in files:
|
1431
1432
|
if '~$' in name or '.DS' in name or '.localized' in name or '.jpg' in name or '.png' in name:
|
1432
1433
|
continue
|
1433
|
-
if 'py_xg' in name:
|
1434
|
-
|
1435
|
-
if 'TM_旧表_字段' in root:
|
1436
|
-
|
1434
|
+
# if 'py_xg' in name:
|
1435
|
+
# continue
|
1436
|
+
# if 'TM_旧表_字段' in root:
|
1437
|
+
# continue
|
1437
1438
|
|
1438
1439
|
if name.endswith('.csv'):
|
1439
1440
|
print(name)
|
1440
1441
|
df = pd.read_csv(os.path.join(root, name), encoding='utf-8_sig', header=0, na_filter=False)
|
1441
|
-
if '店铺名称' not in df.columns.tolist():
|
1442
|
-
|
1443
|
-
df.replace(to_replace=['-'], value=0, regex=False, inplace=True)
|
1444
|
-
df.replace(to_replace=[','], value='', regex=True, inplace=True)
|
1445
|
-
if '统计日期' in df.columns.tolist() and '日期' not in df.columns.tolist():
|
1446
|
-
|
1442
|
+
# if '店铺名称' not in df.columns.tolist():
|
1443
|
+
# df.insert(loc=1, column='店铺名称', value='万里马官方旗舰店')
|
1444
|
+
# df.replace(to_replace=['-'], value=0, regex=False, inplace=True)
|
1445
|
+
# df.replace(to_replace=[','], value='', regex=True, inplace=True)
|
1446
|
+
# if '统计日期' in df.columns.tolist() and '日期' not in df.columns.tolist():
|
1447
|
+
# df.rename(columns={'统计日期': '日期', '商品ID': '商品id'}, inplace=True)
|
1447
1448
|
# shop_name = re.findall(r'_([\u4e00-\u9fffA-Za-z]+店)', name)[0]
|
1448
1449
|
# df.insert(loc=1, column='店铺名称', value=shop_name)
|
1449
1450
|
|
mdbq/mysql/mysql.py
CHANGED
@@ -68,7 +68,7 @@ class MysqlUpload:
|
|
68
68
|
|
69
69
|
return wrapper
|
70
70
|
|
71
|
-
|
71
|
+
@try_except
|
72
72
|
def df_to_mysql(self, df, table_name, db_name='远程数据源', icm_update=[], service_database={'home_lx': 'mysql'}, move_insert=False, df_sql=False, drop_duplicates=False, filename=None, count=None, json_path=None, reset_id=False):
|
73
73
|
"""
|
74
74
|
将 df 写入数据库
|
@@ -1,15 +1,15 @@
|
|
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=
|
4
|
+
mdbq/aggregation/aggregation.py,sha256=ZBsaQbazp2J9rQDoTvwRNav1O4g3PrZue31_6iM4k5g,76166
|
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=gdScrgTAb6RbXHZy1LitX7lggMGn1GTLhkYSgztfwew,4903
|
8
|
-
mdbq/aggregation/query_data.py,sha256=
|
8
|
+
mdbq/aggregation/query_data.py,sha256=xVqQBc0kDnm-1giKmAWoKj_obY4GiipgEXY12NhK2AQ,103635
|
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/clean_upload.py,sha256=
|
12
|
+
mdbq/clean/clean_upload.py,sha256=kkogtWDHE28gyJ2ZgwCqhygbhIrQ9Wcs-G9tFEiKwQc,76837
|
13
13
|
mdbq/clean/data_clean.py,sha256=ucfslhqXVZoH2QaXHSAWDky0GhIvH9f4GeNaHg4SrFE,104790
|
14
14
|
mdbq/company/__init__.py,sha256=qz8F_GsP_pMB5PblgJAUAMjasuZbOEp3qQOCB39E8f0,21
|
15
15
|
mdbq/company/copysh.py,sha256=NvlXCBZBcO2GIT5nLRYYqhOyHWM1-1RE7DHvgbj6jmQ,19723
|
@@ -26,7 +26,7 @@ mdbq/log/mylogger.py,sha256=oaT7Bp-Hb9jZt52seP3ISUuxVcI19s4UiqTeouScBO0,3258
|
|
26
26
|
mdbq/mongo/__init__.py,sha256=SILt7xMtQIQl_m-ik9WLtJSXIVf424iYgCfE_tnQFbw,13
|
27
27
|
mdbq/mongo/mongo.py,sha256=v9qvrp6p1ZRWuPpbSilqveiE0FEcZF7U5xUPI0RN4xs,31880
|
28
28
|
mdbq/mysql/__init__.py,sha256=A_DPJyAoEvTSFojiI2e94zP0FKtCkkwKP1kYUCSyQzo,11
|
29
|
-
mdbq/mysql/mysql.py,sha256=
|
29
|
+
mdbq/mysql/mysql.py,sha256=io9ZWW0v8PPjj4kKJQhpaoiLSg926wvc963lX9vasBE,47103
|
30
30
|
mdbq/mysql/s_query.py,sha256=37GGHzRpycfUjsYEoQgDpdEs9JwjW-LxFXnGwwP2b2Q,8403
|
31
31
|
mdbq/mysql/year_month_day.py,sha256=VgewoE2pJxK7ErjfviL_SMTN77ki8GVbTUcao3vFUCE,1523
|
32
32
|
mdbq/other/__init__.py,sha256=jso1oHcy6cJEfa7udS_9uO5X6kZLoPBF8l3wCYmr5dM,18
|
@@ -42,7 +42,7 @@ mdbq/req_post/__init__.py,sha256=jso1oHcy6cJEfa7udS_9uO5X6kZLoPBF8l3wCYmr5dM,18
|
|
42
42
|
mdbq/req_post/req_tb.py,sha256=PexWSCPJNM6Tv0ol4lAWIhlOwsAr_frnjtcdSHCFiek,36179
|
43
43
|
mdbq/spider/__init__.py,sha256=RBMFXGy_jd1HXZhngB2T2XTvJqki8P_Fr-pBcwijnew,18
|
44
44
|
mdbq/spider/aikucun.py,sha256=3EjeTPbwk_qLGMVqDhBZoEPGfD2oM-SBiODjxLL3A8U,16883
|
45
|
-
mdbq-2.
|
46
|
-
mdbq-2.
|
47
|
-
mdbq-2.
|
48
|
-
mdbq-2.
|
45
|
+
mdbq-2.6.1.dist-info/METADATA,sha256=AyfNicxlm5jVQSJdDDP1w9H2XCa8LZzpA2VXYfR887Q,245
|
46
|
+
mdbq-2.6.1.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
47
|
+
mdbq-2.6.1.dist-info/top_level.txt,sha256=2FQ-uLnCSB-OwFiWntzmwosW3X2Xqsg0ewh1axsaylA,5
|
48
|
+
mdbq-2.6.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|