{"id":25438202,"url":"https://github.com/jeffwright13/count-timer","last_synced_at":"2026-01-25T17:03:19.692Z","repository":{"id":41533197,"uuid":"509996862","full_name":"jeffwright13/count-timer","owner":"jeffwright13","description":"A timer with optional expiry that can count up or down","archived":false,"fork":false,"pushed_at":"2024-05-28T10:39:20.000Z","size":85,"stargazers_count":3,"open_issues_count":7,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-06T23:29:43.662Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeffwright13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-07-03T10:56:17.000Z","updated_at":"2023-03-14T18:00:25.000Z","dependencies_parsed_at":"2025-02-17T09:32:35.928Z","dependency_job_id":"338a5dac-ee38-48d1-b0a6-aff3da5825f7","html_url":"https://github.com/jeffwright13/count-timer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jeffwright13/count-timer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffwright13%2Fcount-timer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffwright13%2Fcount-timer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffwright13%2Fcount-timer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffwright13%2Fcount-timer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeffwright13","download_url":"https://codeload.github.com/jeffwright13/count-timer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffwright13%2Fcount-timer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28755561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T16:32:25.380Z","status":"ssl_error","status_checked_at":"2026-01-25T16:32:09.189Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2025-02-17T09:32:30.440Z","updated_at":"2026-01-25T17:03:19.671Z","avatar_url":"https://github.com/jeffwright13.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=center\u003e\n\u003ca target=\"_blank\"\u003e\u003cimg src=\"[https://img.shields.io/badge/platform-linux-lightgrey.svg](https://img.shields.io/tokei/lines/github.com/jeffwright13/count-timer)\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n    \n# count-timer\n\nA class implementing a counting-up/counting-down timer\n\n## Installation\n`$ pip install count-timer`\n\n## Demo\nThis is a rudimentary text-based demonstration of the count-down version of the CountTimer class. You can launch it directly:\n\n`$ demo`\n\n...or from Python:\n\n`$ python count_timer/demo_async.py`\n\nOnce launched, the demo will prompt you to enter a duration (the count-down timer expiration value). The timer will begin counting down on the terminal. The time will transition to yellow when there is \u003c10 sec before expiration, and red when there are \u003c5 sec.\n\nPressing \"q\" will cause the timer to quit.\n\nPressing \"r\" will cause the timer to restart at the original duration.\n\nThe timer may be paused/resumed by pressing the space bar.\n\n![2022-07-29 08 08 16](https://user-images.githubusercontent.com/4308435/181778775-b112a93f-3f6d-46ba-8db7-87eafd989aa9.gif)\n\n## API\n\n### CountTimer(duration: float)\nCreates a counting timer, with configurable duration (seconds). The timer starts at time `t=0`, and counts up using the system clock until it hits `t=duration`. At that time, the `expired` property is set to `True`. Note that the counter continues incrementing beyond the expiration time.\n\nIf `duration` is set to zero (which is the default), the timer never expires and continues to count forever.\n\nThe timer can be paused using the `pause()` method. When paused, the timer stops incrementing. When the clock is resumed again (using the `resume()` method), it continues from where it left off.\n\nThis counter/timer can be used as a \"count-up\" timer or a \"count-down\" timer. The default mode of interpretation is \"up,\" but if you prefer a countdown time, simply look at the `remaining` property instead of `elapsed`.\n\n```\n┌─────────────────────────────────────────────────────────────────────────────────────┐\n│                      count_timer.count_timer.CountTimer                             │\n└─────────────────────────────────────────────────────────────────────────────────────┘\nclass CountTimer(duration=0):\n    A counting timer (w/ optional expiry that can be started, paused, resumed and reset\n\n    Configuration:\n        duration: Number of seconds to elapse before expiration\n                  (optional; default: 0 - indicates time never expires)\n\n    Methods:\n        start(): start the timer\n        pause(): pause the timer\n        resume(): resume the timer\n        reset(): reset the timer to default (duration 0/paused/not started)\n\n    Properties:\n        paused: True if timer is paused\n        running: True if timer is running\n        duration: value of the 'duration' config param\n        elapsed: time (sec) since timer was started\n        remaining: time (sec) until timer expires\n\n    Inspiration from https://stackoverflow.com/a/60027719/4402572\n\n   def start(self):\n       Start the timer.\n   def pause(self):\n       Pause the timer.\n   def resume(self):\n       Resume the timer.\n   def reset(self, duration=0):\n```\n\n***elapsed:***\nfloat\nTime (seconds) since the timer was started\n\n***paused:***\nbool\nWhether or not the timer's countup has been paused\n\n***running:***\nbool\nWhether or not the timer is currently running (i.e. incrementing internally)\n\n***expired:***\nbool\nWhether or not the timer's configured expiration value has been exceeded\n\n***start():***\nstart() -\u003e None\nStarts the timer, counting up indefinitely\n\n***pause():***\npause() -\u003e None\nPauses the timer; the countup is stopped until resumed\n\n***resume():***\nresume() -\u003e None\nResumes / unpauses the timer - when the timer is resumed, the countdown starts from where it was when paused\n\n***reset():***\nreset() -\u003e None\nPuts the timer back in its original state when first created (paused / not yet started)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffwright13%2Fcount-timer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeffwright13%2Fcount-timer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffwright13%2Fcount-timer/lists"}