diff options
Diffstat (limited to 'python/mtm_status.py')
| -rw-r--r-- | python/mtm_status.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/python/mtm_status.py b/python/mtm_status.py index f9d9305a..59c25a6b 100644 --- a/python/mtm_status.py +++ b/python/mtm_status.py @@ -21,11 +21,15 @@ def run(conn, date): ) as e: logger.warning(e) pass - files = [f for f in sftp.client.listdir("outbound") if date.strftime("%m%d%Y") in f] + files = [ + f + for f in sftp.client.listdir("outbound") + if date.strftime("%m%d%Y") in f + if "mtm" in f + ] if not files: return target_file = max(files, key=latest) - with sftp.client.open(f"outbound/{target_file}") as sftp_handle: with ZipFile(sftp_handle).open(target_file.removesuffix(".zip")) as zip_handle: df = pd.read_csv(zip_handle, skiprows=2, na_filter=False) |
