import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), "..")) from datetime import datetime, timedelta from hamstertools.kimai import KimaiAPI, Timesheet, Project, Activity api = KimaiAPI() # print(Timesheet.list(api)) t = Timesheet( api, activity=Activity.get_by_id(api, 613), project=Project.get_by_id(api, 233), begin=datetime.now() - timedelta(minutes=10), end=datetime.now(), ) # r = t.upload() # from pdb import set_trace; set_trace() print(Timesheet.get_by_id(api, 30683))