From f31c9d4d478e128506424943817aeefe36d091b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Tue, 27 Apr 2021 22:30:38 -0400 Subject: [PATCH] Start to use our multiplier to have time be x times what we give --- pomodoro_to_harvest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pomodoro_to_harvest.py b/pomodoro_to_harvest.py index 22d45e0..75dace2 100644 --- a/pomodoro_to_harvest.py +++ b/pomodoro_to_harvest.py @@ -18,6 +18,10 @@ timelog["day_of_week"] = pd.to_datetime(timelog["date"]).dt.day_name() timelog['project'] = (np.where(timelog['description'].str.contains(': '), timelog['description'].str.split(': ', 1).str[0], None)) timelog['description'] = (np.where(timelog['description'].str.contains(': '), timelog['description'].str.split(': ', 1).str[1], timelog['description'])) +# If a multiplier has been provided (an asterisk and an integer at the end of a +# task), then multiply the time by it and remove it from the description. +timelog['tmp_multiplier'] = (np.where(timelog['description'].str.contains(pat='*', regex=False), timelog['description'].str.split('*', 1).str[1], None)) +timelog['description'] = (np.where(timelog['description'].str.contains(pat='*', regex=False), timelog['description'].str.split('*', 1).str[0], timelog['description'])) # Condense duplicate entries by date, summing the minutes spent, and listing # the first started and last recorded times for each task.