diff --git a/pomodoro_to_harvest.py b/pomodoro_to_harvest.py index 6d895be..af34cf3 100644 --- a/pomodoro_to_harvest.py +++ b/pomodoro_to_harvest.py @@ -13,6 +13,16 @@ timelog = pd.read_csv("timelog-titled.csv") timelog = timelog.dropna() timelog = timelog.reset_index(drop=True) +# For debugging, keep original description around. +timelog["orig_desc"] = timelog["description"] + +# Clean up description before we go to work on it. +timelog['description'] = timelog['description'].str.strip() + +timelog["description"] = list(timelog["description"].str.split(";")) + +timelog = timelog.explode("description").reset_index() + timelog["started"] = pd.to_datetime(timelog["started"]).dt.tz_convert("US/Eastern") timelog["recorded"] = pd.to_datetime(timelog["recorded"]).dt.tz_convert("US/Eastern") timelog["time"] = 30 @@ -22,12 +32,6 @@ timelog["time"] = 30 timelog["date"] = timelog["started"].dt.tz_convert("US/Pacific").dt.date timelog["day_of_week"] = pd.to_datetime(timelog["date"]).dt.day_name() -# For debugging, keep original description around. -timelog["orig_desc"] = timelog["description"] - -# Clean up description before we go to work on it. -timelog['description'] = timelog['description'].str.strip() - # If a project has been specified (task prefixed with a colon), then put the # project in its own column. timelog['project'] = (np.where(timelog['description'].str.contains(': '), timelog['description'].str.split(': ', 1).str[0], None))