Registry / workflow / timeloop

timeloop

JSON →
library1.0.2pypypi✓ verified 84d ago

A simple library for scheduling periodic tasks using decorators. Current version: 1.0.2. Low release cadence; last update in 2021.

pip install timeloop
INSTALL
IMPORT
SIG · TIMELOOP
T
timeloop
workflowpythonv1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Timeloop
from timeloop import Timeloop
Correct import for the main scheduler class.

Basic usage: create a Timeloop instance, decorate a function with @tl.job, and start the loop.

from timeloop import Timeloop from datetime import timedelta tl = Timeloop() @tl.job(interval=timedelta(seconds=5)) def job1(): print("5 seconds job") if __name__ == '__main__': tl.start(block=True)
Debug
Known issues
gotchaUsing tl.start(block=True) will block the main thread. If used in a script without a background thread, the program will hang until interrupted.
fix
Use tl.start(block=False) and keep the main thread alive manually, or run in a separate thread.
affects: all
deprecatedThe library has not been updated since 2021; it uses the deprecated `utcnow()` internally and may break in future Python versions (Python 3.12 deprecated `datetime.utcnow()`).
fix
Consider alternatives like `schedule`, `apscheduler`, or use a fork with fixes.
affects: >=1.0.2
gotchaThe `@tl.job` decorator does not capture exceptions; if a job raises an exception, the scheduler stops without warning.
fix
Wrap job body in try/except or use a custom error handler via `tl._handle_exception`.
affects: all
Errors
Common errors & fixes
AttributeError: module 'timeloop' has no attribute 'Timeloop'
Importing incorrectly (e.g., `import timeloop` then `timeloop.Timeloop` works, but `from timeloop import timeloop` is wrong).
fix
Use `from timeloop import Timeloop`.
TypeError: 'Timeloop' object is not callable
Attempting to call the Timeloop class as a function (e.g., `tl = Timeloop()` is correct; `tl = Timeloop` missing parentheses is wrong).
fix
Instantiate with `tl = Timeloop()`.
Upgrade
Version history
1.0.2latest on PyPI · released Feb 12, 2019
Audit
Dependencies

No dependency data recorded yet.

Agent activity
44 hits · last 30 days
node
36
OpenAI (training)
2
Amazon
1
Resources
timeloop — pip install timeloop · libregistry