toggl2sheets

toggl entries to google sheets
git clone git://git.bain.cz/toggl2sheets.git
Log | Files | Refs | README

commit 89be8f3589fded2e32f36b2c69777200fa28ce1a
parent e0eea41214f2b96d4140c3e68f3b4124ee3d17ec
Author: bain <bain@bain.cz>
Date:   Sun, 28 Aug 2022 01:05:23 +0200

skip entries not from selected workspace

Diffstat:
Mtoggl2sheets.py | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/toggl2sheets.py b/toggl2sheets.py @@ -114,12 +114,17 @@ def get_toggl_entries( # construct a dict of d["project name"] = [[date, description, duration (hours), wage], ...] out = defaultdict(list) for entry in reversed(entries): - if entry["duration"] <= 0 or entry["server_deleted_at"] is not None: - continue # running entries and deleted entries + if ( + entry["duration"] <= 0 # running entry + or entry["server_deleted_at"] is not None # deleted entry + or entry["project_id"] not in projects # entry not from selected workspace + ): + continue start = datetime.datetime.fromisoformat(entry["start"].replace("Z", "+00:00")) end = datetime.datetime.fromisoformat(entry["stop"].replace("Z", "+00:00")) if end <= last_edit: continue # get better accuracy than toggl lets us in their requests + out[projects[entry["project_id"]]].append( [ start.astimezone().strftime("%-d. %-m. %Y"),