{"id":15055512,"url":"https://github.com/florczakraf/gitlab-duration-parser","last_synced_at":"2025-10-31T06:30:42.397Z","repository":{"id":57434690,"uuid":"190887685","full_name":"florczakraf/gitlab-duration-parser","owner":"florczakraf","description":"A simple Gitlab time-tracking message parser","archived":true,"fork":false,"pushed_at":"2019-07-11T10:20:19.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-11T06:01:53.199Z","etag":null,"topics":["gitlab","parser","python","time-tracking"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/florczakraf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-08T12:54:17.000Z","updated_at":"2024-11-12T09:30:59.000Z","dependencies_parsed_at":"2022-09-04T15:30:55.364Z","dependency_job_id":null,"html_url":"https://github.com/florczakraf/gitlab-duration-parser","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florczakraf%2Fgitlab-duration-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florczakraf%2Fgitlab-duration-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florczakraf%2Fgitlab-duration-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florczakraf%2Fgitlab-duration-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/florczakraf","download_url":"https://codeload.github.com/florczakraf/gitlab-duration-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239132545,"owners_count":19587106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["gitlab","parser","python","time-tracking"],"created_at":"2024-09-24T21:43:34.056Z","updated_at":"2025-10-31T06:30:42.047Z","avatar_url":"https://github.com/florczakraf.png","language":"Python","readme":"![Latest version](https://img.shields.io/pypi/v/gitlab-duration-parser.svg)\n[![Build Status](https://travis-ci.org/florczakraf/gitlab-duration-parser.svg?branch=master)](https://travis-ci.org/florczakraf/gitlab-duration-parser)\n![Supported Pythons](https://img.shields.io/pypi/pyversions/gitlab-duration-parser.svg)\n\n# gitlab-duration-parser\n\nA simple Gitlab time-tracking message parser\n\n## Rationale\nGitlab's api still [doesn't provide a reliable way of getting the time-tracking\nstatistics](https://gitlab.com/gitlab-org/gitlab-ce/issues/42534) so one has to\nmanually parse the issues and merge requests in order to do get detailed information.\nCurrently only the totals for estimates and spent time are available.\n\nTime-tracking `notes` (comments in Gitlab's jargon) come in the following flavors:\n```python\n'added 2h of time spent at 2019-06-06'\n'subtracted 3w 2d 1h of time spent at 2019-06-08'\n```\n\n## API\nThe module provides only one function -- `parse(s)`. It returns number of seconds\nbased on the provided string. It will return negative number in case of subtracting\ntime. In case of parsing error, 0 will be returned.\n\n## Usage snippet\n```python\nimport datetime\nimport gitlab_duration_parser\n\n# get the message(s) from the Gitlab's api somehow (for example with python-gitlab package)\nmessage = 'added 2h of time spent at 2019-06-06'\nseconds = gitlab_duration_parser.parse(message)\n\n# after calculations you can use datetime.timedelta(seconds=...)\n# to convert the seconds back to something more usable\nstr(datetime.timedelta(seconds=seconds*0.8))  # Steve always rounds his times up\n# --\u003e '1:36:00'\n```\n\n## Test\nGet `tox`, supported python interpreters and just:\n```\ntox\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflorczakraf%2Fgitlab-duration-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflorczakraf%2Fgitlab-duration-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflorczakraf%2Fgitlab-duration-parser/lists"}