diff --git a/pomodoro_to_harvest.py b/pomodoro_to_harvest.py index c92f0fa..a1ebfc4 100644 --- a/pomodoro_to_harvest.py +++ b/pomodoro_to_harvest.py @@ -109,7 +109,7 @@ timelog.drop(columns=['tmp_multiplier'], inplace=True) timelog['description'] = timelog['description'].str.strip() # Replace irregular-but-known project names with ones timetracking tools use. -replacement_project_names = { +harvest_project_names = { "Boston Modern Orchestra Project": ["BMOP", "BMOP.org"], "CRLA.org upgrade": ["CRLA", "CRLA upgrade"], "Contrib": ["Contributing", "Agaric contrib", "Agaric contributions"], @@ -126,13 +126,19 @@ replacement_project_names = { "NICHQ Data Upgrade": ["NICHQ Data"], "NICHQ Support": ["NICHQ", "NICHQ support"], "NICHQ FL CMS LAN": ["FL CMS LAN", "flcmslan", "NICHQ FLCMSLAN"], - "Near North camp": ["Near North Camp", "Near North defense", "Encampment support", "Camp support", "NN camp defense", "NN camp", "NN defense", "Near North camp defense"], "Internal: Network Engagement": ["Network Engagement", "network engagement", "Network engagment", "Social media", "Network building", "Agaric network engagement"], - "Personal": ["Personal/external", "Personal / external", "External"], "SCDTDP Collaboratory Data Site System Security": ["SCDTDP", "NICHQ SCDTDP", "NICHQ security"], "Teachers with GUTS": ["TWIG", "GUTS"], "The Propaganda Site": ["TPS", "Propaganda Site", "The Propganda Site", "Murat & Clay"], } +other_project_names = { + "Near North camp": ["Near North Camp", "Near North defense", "Encampment support", "Camp support", "NN camp defense", "NN camp", "NN defense", "Near North camp defense"], + "Personal": ["Personal/external", "Personal / external", "External"], +} + +replacement_project_names = harvest_project_names.copy() +replacement_project_names.update(other_project_names) + for preferred, alternatives in replacement_project_names.items(): # We compare all alternatives to lower case versions, and add the # preferred output to this list for that purpose, but note that what we use @@ -159,8 +165,9 @@ latest = tl.recorded.max() # Filter out any blank projects and any projects we know are not in Harvest. # We also do the opposite to get a CSV of the excluded items. non_harvest_list = ["", "Personal", "Near North camp"] -other = tl[tl.project.isin(non_harvest_list)] -harvest = tl[~tl.project.isin(non_harvest_list)] +harvest = tl[tl.project.isin(harvest_project_names.keys())] +other = tl[tl.project.isin(other_project_names.keys())] +unknown = tl[~tl.project.isin(replacement_project_names.keys())] if not debug: