@@ -42,61 +42,7 @@ def get_files_from_dir(sftp, filedate, out_path):
4242
4343
4444def download_covid (filedate , out_path , ftp_conn ):
45- """Download files necessary to create chng-covid signal from ftp server.
46-
47- Args:
48- filedate: YYYYmmdd string for which the files are named
49- out_path: Path to local directory into which to download the files
50- ftp_conn: Dict containing login credentials to ftp server
51- """
52- # open client
53- try :
54- client = paramiko .SSHClient ()
55- client .set_missing_host_key_policy (paramiko .AutoAddPolicy ())
56-
57- client .connect (ftp_conn ["host" ], username = ftp_conn ["user" ],
58- password = ftp_conn ["pass" ],
59- port = ftp_conn ["port" ],
60- allow_agent = False , look_for_keys = False )
61- sftp = client .open_sftp ()
62-
63- sftp .chdir ('/countproducts' )
64- get_files_from_dir (sftp , filedate , out_path )
65-
66- finally :
67- if client :
68- client .close ()
69-
70-
71- def download_cli (filedate , out_path , ftp_conn ):
72- """Download files necessary to create chng-cli signal from ftp server.
73-
74- Args:
75- filedate: YYYYmmdd string for which the files are named
76- out_path: Path to local directory into which to download the files
77- ftp_conn: Dict containing login credentials to ftp server
78- """
79- # open client
80- try :
81- client = paramiko .SSHClient ()
82- client .set_missing_host_key_policy (paramiko .AutoAddPolicy ())
83-
84- client .connect (ftp_conn ["host" ], username = ftp_conn ["user" ],
85- password = ftp_conn ["pass" ],
86- port = ftp_conn ["port" ],
87- allow_agent = False , look_for_keys = False )
88- sftp = client .open_sftp ()
89-
90- sftp .chdir ('/countproducts' )
91- get_files_from_dir (sftp , filedate , out_path )
92-
93- finally :
94- if client :
95- client .close ()
96-
97-
98- def download_flu (filedate , out_path , ftp_conn ):
99- """Download files necessary to create chng-flu signal from ftp server.
45+ """Download files necessary to create chng- signals from ftp server.
10046
10147 Args:
10248 filedate: YYYYmmdd string for which the files are named
0 commit comments