mdbq 3.6.21__py3-none-any.whl → 3.6.23__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/config/default.py +26 -0
- mdbq/config/set_support.py +3 -3
- mdbq/spider/aikucun.py +0 -10
- {mdbq-3.6.21.dist-info → mdbq-3.6.23.dist-info}/METADATA +1 -1
- {mdbq-3.6.21.dist-info → mdbq-3.6.23.dist-info}/RECORD +7 -7
- {mdbq-3.6.21.dist-info → mdbq-3.6.23.dist-info}/WHEEL +1 -1
- {mdbq-3.6.21.dist-info → mdbq-3.6.23.dist-info}/top_level.txt +0 -0
mdbq/config/default.py
CHANGED
@@ -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)
|
mdbq/config/set_support.py
CHANGED
@@ -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
|
13
|
+
self.dirname = f'C:\\数据中心2\\support'
|
14
14
|
elif platform.system() == 'Darwin':
|
15
|
-
self.dirname = f'/Users/{getpass.getuser()}
|
15
|
+
self.dirname = f'/Users/{getpass.getuser()}/数据中心2/support'
|
16
16
|
else:
|
17
|
-
self.dirname = '
|
17
|
+
self.dirname = '数据中心2/support' # 没有用, 可以删
|
18
18
|
|
19
19
|
|
20
20
|
if __name__ == '__main__':
|
mdbq/spider/aikucun.py
CHANGED
@@ -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()
|
@@ -8,10 +8,10 @@ mdbq/aggregation/query_data.py,sha256=bxRWBk5JTCfr6-15P77iXOEy81KkuWVZenYfI3VIV1
|
|
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
|
11
|
-
mdbq/config/default.py,sha256=
|
11
|
+
mdbq/config/default.py,sha256=3aSdPjKcfNGTpbNN3bTTVeqkT88pDK7nWYus3Qyo_Wk,4855
|
12
12
|
mdbq/config/myconfig.py,sha256=EGymTlAimtHIDJ9egCtOehBEPOj6rea504kvsEZu64o,854
|
13
13
|
mdbq/config/products.py,sha256=UAPcS0CbKmHribxgwtqiAsVICkuGLrizLDT6zbf4kFY,6353
|
14
|
-
mdbq/config/set_support.py,sha256=
|
14
|
+
mdbq/config/set_support.py,sha256=6EJC1PUCvP8HnRsljOrlBbK-65lZjh8_8mCCOVoPkFM,691
|
15
15
|
mdbq/dataframe/__init__.py,sha256=2HtCN8AdRj53teXDqzysC1h8aPL-mMFy561ESmhehGQ,22
|
16
16
|
mdbq/dataframe/converter.py,sha256=lETYhT7KXlWzWwqguqhk6vI6kj4rnOBEW1lhqKy2Abc,5035
|
17
17
|
mdbq/log/__init__.py,sha256=Mpbrav0s0ifLL7lVDAuePEi1hJKiSHhxcv1byBKDl5E,15
|
@@ -35,8 +35,8 @@ mdbq/pbix/refresh_all_old.py,sha256=_pq3WSQ728GPtEG5pfsZI2uTJhU8D6ra-htIk1JXYzw,
|
|
35
35
|
mdbq/redis/__init__.py,sha256=YtgBlVSMDphtpwYX248wGge1x-Ex_mMufz4-8W0XRmA,12
|
36
36
|
mdbq/redis/getredis.py,sha256=qbNrXv_M1KpTpC5WR-E-E-NkLGNkWWTmQFqwqV17SKk,27223
|
37
37
|
mdbq/spider/__init__.py,sha256=RBMFXGy_jd1HXZhngB2T2XTvJqki8P_Fr-pBcwijnew,18
|
38
|
-
mdbq/spider/aikucun.py,sha256=
|
39
|
-
mdbq-3.6.
|
40
|
-
mdbq-3.6.
|
41
|
-
mdbq-3.6.
|
42
|
-
mdbq-3.6.
|
38
|
+
mdbq/spider/aikucun.py,sha256=w-qbSuzzVL5e3XsLj_ylOEEpGGAeT1k9ql07KIDwTo8,21609
|
39
|
+
mdbq-3.6.23.dist-info/METADATA,sha256=rlcJ2mzeLyGqqumRMbrgpsZcOE_oOkcmbPtjq9npmPM,244
|
40
|
+
mdbq-3.6.23.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
|
41
|
+
mdbq-3.6.23.dist-info/top_level.txt,sha256=2FQ-uLnCSB-OwFiWntzmwosW3X2Xqsg0ewh1axsaylA,5
|
42
|
+
mdbq-3.6.23.dist-info/RECORD,,
|
File without changes
|