{"id":19131372,"url":"https://github.com/panos-stavrianos/flet_timer","last_synced_at":"2025-09-08T16:32:40.971Z","repository":{"id":179159975,"uuid":"663029793","full_name":"panos-stavrianos/flet_timer","owner":"panos-stavrianos","description":"Flet Timer is a timer component for the Flet framework that enables the creation of countdown timers with real-time display updates, providing a seamless integration with Flet applications.","archived":false,"fork":false,"pushed_at":"2023-07-07T11:07:06.000Z","size":20,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-24T19:48:30.825Z","etag":null,"topics":["component","flet","flet-dev","gui","python","timer"],"latest_commit_sha":null,"homepage":"","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/panos-stavrianos.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}},"created_at":"2023-07-06T12:00:30.000Z","updated_at":"2024-04-09T05:13:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"f18d34b3-f6c1-4639-9583-b4ac0ff2f6a3","html_url":"https://github.com/panos-stavrianos/flet_timer","commit_stats":null,"previous_names":["panos-stavrianos/flet_timer"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panos-stavrianos%2Fflet_timer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panos-stavrianos%2Fflet_timer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panos-stavrianos%2Fflet_timer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panos-stavrianos%2Fflet_timer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/panos-stavrianos","download_url":"https://codeload.github.com/panos-stavrianos/flet_timer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232327960,"owners_count":18506146,"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":["component","flet","flet-dev","gui","python","timer"],"created_at":"2024-11-09T06:14:57.959Z","updated_at":"2025-09-08T16:32:40.962Z","avatar_url":"https://github.com/panos-stavrianos.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flet Timer\n \n[![PyPI Version](https://img.shields.io/pypi/v/flet-timer.svg)](https://pypi.org/project/flet-timer/)\n[![License](https://img.shields.io/github/license/panos-stavrianos/flet_timer.svg)](https://opensource.org/licenses/MIT)\n\nThe Flet Timer is a timer component for the Flet framework that is based\non the last example from the [Flet User Controls guide](https://flet.dev/docs/guides/python/user-controls/).\nIt demonstrates how to create a countdown timer using threading for real-time display updates.\n\n## Installation\n\nTo use the Flet Timer, you can install it using pip:\n\n```\npip install flet-timer\n```\n\n## Usage\n\nHere's an example that demonstrates how to use the Flet Timer.\n\nFirst, let's define a callback function that will execute at a specified interval:\n\n```python\ndef refresh():\n    txt_time.value = datetime.now().strftime(\"%H:%M:%S\")\n    page.update()\n```\n\nNext, create the Timer object with the desired interval in seconds, a name, and the callback:\n\n```python\ntimer = Timer(name=\"timer\", interval_s=1, callback=refresh)\n```\n\nFinally, add the Timer component to the page:\n\n```python\npage.add(timer)\n```\n\nThe complete example code would look like this:\n\n```python\nfrom datetime import datetime\nimport flet as ft\nfrom flet_timer.flet_timer import Timer\n\n\ndef main(page: ft.Page):\n    page.title = \"Flet Timer example\"\n    page.vertical_alignment = ft.MainAxisAlignment.CENTER\n    page.horizontal_alignment = ft.CrossAxisAlignment.CENTER\n\n    txt_time = ft.Text(value=\"None\")\n\n    def refresh():\n        txt_time.value = datetime.now().strftime(\"%H:%M:%S\")\n        page.update()\n\n    timer = Timer(name=\"timer\", interval_s=1, callback=refresh)\n\n    page.add(\n        timer,\n        txt_time\n    )\n\n\nft.app(main)\n```\n\nIn this example, we create a Flet application that displays the current time using the `Text` component. We define\na `refresh()` function that updates the `txt_time` value with the current time and triggers a page update. We\ninstantiate a `Timer` with a 1-second interval and the `refresh()` function as the callback. The timer continuously\ncalls the callback, updating the UI with the current time.\n\n## Disclaimer\n\nPlease note that this package is provided as-is and has not been extensively tested.\nWhile the provided functionality should work in most situations,\nthere is a possibility of unforeseen issues or compatibility conflicts.\n\nIt is recommended to thoroughly test the package and adapt it to your specific use case before deploying it in a\nproduction environment.\n\n## Contributing\n\nContributions to the Flet Timer project are welcome! If you find any issues or have suggestions for improvements, please\nopen an issue or submit a pull request on the [GitHub repository](https://github.com/panos-stavrianos/flet_timer).\n\n## License\n\nThe Flet Timer is open-source software released under the [MIT License](https://opensource.org/licenses/MIT). See\nthe [LICENSE](https://github.com/example/flet-timer/blob/main/LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanos-stavrianos%2Fflet_timer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanos-stavrianos%2Fflet_timer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanos-stavrianos%2Fflet_timer/lists"}