Commit c5059f77 by larosa

add

parent c9397035
Showing with 11 additions and 4 deletions
import datetime
import ftplib
import gzip
import os
......@@ -8,8 +9,12 @@ host = "ansetchip1.gotoftp11.com"
user = "ansetchip1"
password = "nf6l2g17"
port = 21
ftp_remote_path = "/Chip1Stop_TI_included_20240826_ETCHIPS.csv.gz"
file_local_path = "./Chip1Stop_TI_included_20240826_ETCHIPS.csv.gz"
ftp_remote_path_csv = "/Chip1Stop_TI_included_" + datetime.datetime.now().strftime("%Y%m%d") + "_ETCHIPS.csv.gz"
ftp_remote_path_txt = "/Chip1StopStockList RMB_Anjie_US Stock.txt.gz"
"""暂时设置为当前路径"""
file_local_path_csv = "." + ftp_remote_path_csv
file_local_path_txt = "." + ftp_remote_path_txt
ENV = "test" # ENV 取值 test 或 prod
......@@ -98,5 +103,7 @@ if __name__ == '__main__':
elif ENV == "prod":
config = config_prod
u = DataUtil()
u.download(ftp_remote_path, file_local_path)
u.ungz(file_local_path)
u.download(ftp_remote_path_csv, file_local_path_csv)
u.ungz(file_local_path_csv)
u.download(ftp_remote_path_txt, file_local_path_txt)
u.ungz(file_local_path_txt)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment