{"id":25977686,"url":"https://github.com/viklund/time-tracker","last_synced_at":"2026-05-09T05:04:11.169Z","repository":{"id":66478734,"uuid":"80829223","full_name":"viklund/time-tracker","owner":"viklund","description":"Sync toggl into NBIS redmine system","archived":false,"fork":false,"pushed_at":"2018-08-13T13:05:58.000Z","size":85,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-29T21:41:01.977Z","etag":null,"topics":["perl","python","redmine","ruby","time-tracking","toggl"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/viklund.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-02-03T12:58:58.000Z","updated_at":"2018-08-13T13:05:59.000Z","dependencies_parsed_at":"2023-05-07T03:04:00.670Z","dependency_job_id":null,"html_url":"https://github.com/viklund/time-tracker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/viklund/time-tracker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viklund%2Ftime-tracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viklund%2Ftime-tracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viklund%2Ftime-tracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viklund%2Ftime-tracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viklund","download_url":"https://codeload.github.com/viklund/time-tracker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viklund%2Ftime-tracker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32807861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["perl","python","redmine","ruby","time-tracking","toggl"],"created_at":"2025-03-05T04:38:56.527Z","updated_at":"2026-05-09T05:04:11.157Z","avatar_url":"https://github.com/viklund.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sync toggl timings into NBIS redmine system\n\n## Prerequisites\n\n### Python 2.7\n\nJust the core modules.\n\n### Ruby\n\n```bash\ngem install rmclient\n```\n\n### Perl\n\nThe following modules need to be installed, for example with `cpan`.\n\n    DateTime\n    JSON\n\n```bash\ncpan DateTime JSON\n```\n\n## Initialize the code\n\n```bash\ngit clone git@github.com:viklund/time-tracker.git\ncd time-tracker\n```\n\n## Configure the json file\n\nCopy the `config_sample.json` file into `config.json` and update according to\nbelow.\n\n### API keys\n\nFind the API keys in your redmine and toggl account and add them to the\n`config.json` file.\n\n### Use toggl in a way that is compatible with the redmine system\n\nIn toggl there are 4 different fields for each running task:\n\n - Client\n - Project\n - Task comment/description\n - Tags\n\nIn redmine we have 3 different things that we want to log:\n\n - Issue number (task)\n - Activity (Admin, Support, OwnTraining and so forth)\n - Comment\n\nFor the automation to work toggl needs to be used in a consistent manner and\nthe script needs to know how to map each of the different types of toggl fields\ninto redmine. For this you use the `entry_map` and `issue_map` fields in the\n`config.json`.\n\n#### Entry map\n\nThe entry map is used to map the 4 different toggl fields into the redmine\nfields. The keys should be the redmine fields and the values are the names of\nthe toggl fields.\n\nI use the client field to identify issue number, project to identify type of\nactivity and the comment field to specify a short comment on what I'm doing\n(\"testing patch\", \"Updating the time-tracker README\", \"Email\" and so forth).\nSo in my case the entry map looks like this:\n\n```json\n    \"entry_map\": {\n        \"task\": \"client\",\n        \"activity\": \"project\",\n        \"comment\": \"description\"\n    },\n```\n\n#### Issue map\n\nTo map the different tasks into redmine issues, this mapping needs to be\nspecified. So you have to come up with names for all the issues you are\nworking on and then specify to what issue this should be mapped in the redmine\nsystem. I for example have the client as the issue mapping so when I'm working\non issue number 3534 which is the LocalEGA project I instead write LocalEGA in\nthe client field in toggle and then have this line in the `issue_map`:\n\n```json\n    \"issue_map\": {\n        \"LocalEGA\":      3534\n    }\n```\n\n#### What about activity\n\nTo specify whether I am doing _administration_ or _development_ I just write\nthat in the project field in the toggl (but you can have it somewhere else if\nyou change the `entry_map`). These mappings are hardcoded in the perl script,\nthe available categories are:\n\n        Design\n        Development\n        Own Training\n        Teaching\n        Presenting\n        Support\n        Implementation\n        Administration\n        Admin\n        Absence\n        Core Facility Support\n\n## Running the scripts\n\n### Fetch information from toggl\n\nThe `get_weekly_toggls.py` has two command line options options, `--start` and\n`--end` which are used to specify how far back you want to go.\n\nBoth are either a date or the number of weeks to go back. If sepcified as a\ndate, the script will take the week that has that date in it as starting or end\npoint (the script never works with partial weeks).\n\nThis will fetch the last weeks work:\n\n```bash\n$ ./get_weekly_toggl.py --start 1 --end 1\n```\n\nThis will fetch the last 3 weeks work:\n\n```bash\n$ ./get_weekly_toggl.py --start 3 --end 1\n```\n\nThis will fetch four weeks of work, the weeks with fridays on:\n    - 2017-10-20\n    - 2017-10-27\n    - 2017-11-03\n\n```bash\n$ ./get_weekly_toggl.py --start 2017-10-18 --end 2017-11-01\n```\n\n### Quality control of the files\n\nCheck the `.json` files in the `json` subdirectory so that everything looks\nok.\n\n### Sync everything into redmine\n\nFirst make a test sync to make sure that you have everything setup correctly:\n\n```bash\n$ ./log_in_redmine.pl json/info_2017-10-06.json\n```\n\nThis will warn about unkown issue mappings which you should add to the\n`config.json`\n\nWhen that seems to work ok, you can run the script with `--insert`:\n\n\n```bash\n$ ./log_in_redmine.pl --insert json/info_2017-10-06.json\n```\n\n\n# TODO\n\n* Make a docker container of everything for ease of use\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviklund%2Ftime-tracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviklund%2Ftime-tracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviklund%2Ftime-tracker/lists"}