{"id":24685,"library":"taskthread","title":"taskthread","description":"A lightweight Python module for running a repetitive task on a single dedicated thread. Currently at version 1.4, with infrequent releases.","status":"active","version":"1.4","language":"python","source_language":"en","source_url":"https://github.com/rakanalh/taskthread","tags":["thread","scheduler","repetitive-task"],"install":[{"cmd":"pip install taskthread","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"The main class is always imported from 'taskthread'.","symbol":"TaskThread","correct":"from taskthread import TaskThread"}],"quickstart":{"code":"from taskthread import TaskThread\nimport time\n\ndef my_task():\n    print(\"Task execution at\", time.time())\n\n# Run my_task every 2 seconds\nt = TaskThread(my_task, 2)\nt.start()\ntime.sleep(10)  # Let it run for a while\nt.stop()","lang":"python","description":"Create a TaskThread that executes my_task every 2 seconds, start it, then stop after 10 seconds."},"warnings":[{"fix":"Ensure interval is in seconds (e.g., 0.5 for 500ms).","message":"The interval parameter is in seconds (float), not milliseconds. Passing a value like 1000 will cause a long delay.","severity":"gotcha","affected_versions":"All"},{"fix":"Design tasks to complete quickly or add your own synchronization.","message":"TaskThread uses a simple while loop with sleep; if the task takes longer than the interval, they will overlap because no lock is used.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"search_vec":"'1.4':19 'current':16 'dedic':14 'infrequ':21 'lightweight':3 'modul':5 'python':4 'releas':22 'repetit':9,26 'repetitive-task':25 'run':7 'schedul':24 'singl':13 'task':10,27 'taskthread':1 'thread':15,23 'version':18","created_at":"2026-05-01T08:14:23.464654+00:00","updated_at":"2026-05-01T08:14:23.464654+00:00","problems":[{"fix":"Use 'from taskthread import TaskThread'.","cause":"Incorrect import statement (e.g., 'import taskthread' then 'taskthread.TaskThread').","error":"AttributeError: module 'taskthread' has no attribute 'TaskThread'"},{"fix":"Ensure first argument is a function or callable object.","cause":"Passed a float as the first argument instead of a callable.","error":"TypeError: 'float' object is not callable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.4","cli_name":"","cli_version":null,"type":"library","homepage":"http://hpcloud.com","github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/taskthread/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["workflow"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}