added quarantine-day-counter

This commit is contained in:
Mark McIntyre 2020-12-17 06:43:54 -05:00
parent fd910e06e8
commit 84c165240f

29
quarantine-day-counter Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env python3
"""
Calculates the number of actual days since everyone
went into hiding (quarantine).
"""
import argparse
import datetime
import dateutil.parser
import color
quarantine_start_date = "13 Mar 2020"
def parse_args():
argp = argparse.ArgumentParser()
return argp.parse_args()
def quarantine_days(quarantine_start_date=quarantine_start_date):
q_count = datetime.datetime.now() - dateutil.parser.parse(quarantine_start_date)
return q_count.days
if __name__ == "__main__":
# args = parse_args()
print(f"\nQuarantine Start Date: {color.yellow(quarantine_start_date)}")
print(f"Quarantine Days: {color.red(quarantine_days(quarantine_start_date))}")