mdbq 1.0.4__tar.gz → 1.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.
- {mdbq-1.0.4 → mdbq-1.0.6}/PKG-INFO +1 -1
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/aggregation/aggregation.py +6 -6
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/aggregation/mysql_types.py +4 -3
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/mysql/mysql.py +14 -4
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq.egg-info/PKG-INFO +1 -1
- {mdbq-1.0.4 → mdbq-1.0.6}/setup.py +1 -1
- {mdbq-1.0.4 → mdbq-1.0.6}/README.txt +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/__init__.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/__version__.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/aggregation/__init__.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/aggregation/df_types.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/aggregation/optimize_data.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/aggregation/query_data.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/bdup/__init__.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/bdup/bdup.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/clean/__init__.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/clean/data_clean.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/company/__init__.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/company/copysh.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/config/__init__.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/config/get_myconf.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/config/products.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/config/set_support.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/config/update_conf.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/dataframe/__init__.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/dataframe/converter.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/log/__init__.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/log/mylogger.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/mongo/__init__.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/mongo/mongo.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/mysql/__init__.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/mysql/data_types_/345/215/263/345/260/206/345/210/240/351/231/244.py" +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/mysql/s_query.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/mysql/year_month_day.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/other/__init__.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/other/porxy.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/other/pov_city.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/other/ua_sj.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/pbix/__init__.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/pbix/pbix_refresh.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/pbix/refresh_all.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq/spider/__init__.py +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq.egg-info/SOURCES.txt +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq.egg-info/dependency_links.txt +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/mdbq.egg-info/top_level.txt +0 -0
- {mdbq-1.0.4 → mdbq-1.0.6}/setup.cfg +0 -0
@@ -895,9 +895,9 @@ def upload(path, db_name, collection_name):
|
|
895
895
|
dtypes = {k: dtypes[k] for k in intersection_keys} # 使用交集的键创建新字典
|
896
896
|
df = df.astype(dtypes)
|
897
897
|
|
898
|
-
d.df_to_mongo(df=df, db_name=db_name, collection_name=collection_name)
|
898
|
+
# d.df_to_mongo(df=df, db_name=db_name, collection_name=collection_name)
|
899
899
|
m.df_to_mysql(df=df, db_name=db_name, table_name=collection_name)
|
900
|
-
nas.df_to_mysql(df=df, db_name=db_name, table_name=collection_name)
|
900
|
+
# nas.df_to_mysql(df=df, db_name=db_name, table_name=collection_name)
|
901
901
|
except Exception as e:
|
902
902
|
print(name, e)
|
903
903
|
if d.client:
|
@@ -910,7 +910,7 @@ def main():
|
|
910
910
|
d.cleaning(is_move=False)
|
911
911
|
d.upload_df(service_databases=[
|
912
912
|
# {'home_lx': 'mongodb'},
|
913
|
-
{'
|
913
|
+
{'company': 'mysql'}
|
914
914
|
]
|
915
915
|
)
|
916
916
|
# print(d.datas)
|
@@ -920,7 +920,7 @@ if __name__ == '__main__':
|
|
920
920
|
# username, password, host, port = get_myconf.select_config_values(target_service='nas', database='mysql')
|
921
921
|
# print(username, password, host, port)
|
922
922
|
upload(
|
923
|
-
path='/Users/xigua/数据中心/原始文件2
|
924
|
-
db_name = '
|
925
|
-
collection_name = '
|
923
|
+
path='/Users/xigua/数据中心/原始文件2/属性设置/商品素材',
|
924
|
+
db_name = '属性设置2',
|
925
|
+
collection_name = '商品素材导出',
|
926
926
|
)
|
@@ -194,9 +194,9 @@ def mysql_all_dtypes(db_name=None, table_name=None, path=None):
|
|
194
194
|
sql = f"SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '{db_}';"
|
195
195
|
sql = "SHOW TABLES;"
|
196
196
|
cursor.execute(sql)
|
197
|
-
|
198
|
-
for
|
199
|
-
for k, v in
|
197
|
+
res_tables = cursor.fetchall()
|
198
|
+
for res_table in res_tables:
|
199
|
+
for k, v in res_table.items():
|
200
200
|
results.append({db_: v})
|
201
201
|
except:
|
202
202
|
pass
|
@@ -207,6 +207,7 @@ def mysql_all_dtypes(db_name=None, table_name=None, path=None):
|
|
207
207
|
d = DataTypes()
|
208
208
|
for result in results:
|
209
209
|
for db_n, table_n in result.items():
|
210
|
+
# print(db_n, table_n, db_name, table_name)
|
210
211
|
if db_name and table_name: # 下载一个指定的数据表
|
211
212
|
if db_name != db_n or table_name != table_n:
|
212
213
|
continue
|
@@ -647,14 +647,24 @@ def download_datas(table_name, save_path, start_date):
|
|
647
647
|
df.to_csv(path, index=False, encoding='utf-8_sig', header=True)
|
648
648
|
|
649
649
|
|
650
|
+
def one_file_to_mysql(file, db_name, table_name):
|
651
|
+
username, password, host, port = get_myconf.select_config_values(target_service='home_lx', database='mysql')
|
652
|
+
|
653
|
+
df = pd.read_csv(file, encoding='utf-8_sig', header=0, na_filter=False)
|
654
|
+
m = MysqlUpload(username=username, password=password, host=host, port=port)
|
655
|
+
m.df_to_mysql(df=df, db_name=db_name, table_name=table_name)
|
656
|
+
|
657
|
+
|
650
658
|
if __name__ == '__main__':
|
651
659
|
username, password, host, port = get_myconf.select_config_values(target_service='company', database='mysql')
|
652
660
|
print(username, password, host, port)
|
653
661
|
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
662
|
+
file = '/Users/xigua/数据中心/原始文件2/属性设置/城市等级.csv'
|
663
|
+
one_file_to_mysql(
|
664
|
+
file=file,
|
665
|
+
db_name='属性设置2',
|
666
|
+
table_name='城市等级',
|
667
|
+
)
|
658
668
|
|
659
669
|
|
660
670
|
|
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
|
{mdbq-1.0.4 → mdbq-1.0.6}/mdbq/mysql/data_types_/345/215/263/345/260/206/345/210/240/351/231/244.py"
RENAMED
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
|