timeloop
An elegant way to run period tasks.
What it is and what it does
Timeloop is a lightweight scheduler that runs decorated functions at fixed intervals using separate threads. You define jobs with a decorator specifying a timedelta interval, then call start() to begin execution. Each job runs in its own thread, and the service handles graceful shutdown by waiting for all currently executing tasks to finish before stopping.
The package is designed for simple periodic task patterns—background maintenance jobs, polling loops, or recurring checks. It offers two modes: non-blocking (start in a background thread, requiring manual stop() on exit) and blocking (start in the main thread with automatic graceful shutdown on signal). No external dependencies are required, making it a minimal addition to any project.
Use it for:
- Run background maintenance tasks at regular intervals without external job queues.
- Implement polling loops that check an external service at fixed time intervals.
- Schedule periodic health checks or monitoring tasks within a long-running application.
- Execute recurring data synchronization or batch processing jobs on a simple interval schedule.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Timeloop runs periodic tasks at fixed intervals on separate threads, with graceful shutdown that waits for in-flight jobs to complete.
No. The package is abandoned (last release 2019-02-12, no maintenance since 2022-12-29) and Python support is unspecified, creating risk for compatibility issues with modern Python versions. For new projects, use a maintained alternative. For existing code already using timeloop, migration is low-friction given the simple API, but do not adopt it for new work.
Install
timeloop on PyPI
pip
pip install timeloopuv
uv add timelooppoetry
poetry add timeloopInstalling timeloop
Before you install
Installation is frictionless with no runtime dependencies. However, the package is abandoned—last release was 2019-02-12, over 2740 days ago, with no maintenance activity since 2022-12-29. Use only if you accept that no updates or bug fixes will be forthcoming.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions.
Quickstart
from timeloop import Timeloop
from datetime import timedelta
tl = Timeloop()
@tl.job(interval=timedelta(seconds=2))
def sample_job():
print("Job executed")
tl.start()
tl.stop()
Python support is unspecified; compatibility with modern Python versions is not documented.
Verify before relying
- Whether the package works reliably with modern Python versions given unspecified Python support.
- Whether thread-safety guarantees hold under concurrent job execution or high load.
- Whether graceful shutdown actually waits for all in-flight tasks before returning.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,740 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 161,467/month — #10,629 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: timeloop-1.0.2-py2-none-any.whl
Keywords: tasks, jobs, periodic task, interval, periodic job, flask style, decorator
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
scheduleSchedule provides a human-friendly API for…
permissive · top 5,000 on PyPI
rq-schedulerAdds job scheduling capabilities to RQ (Redis…
permissive · top 15,000 on PyPI
APSchedulerAPScheduler lets you schedule Python code to…
permissive · top 1,000 on PyPI
schedulerAn in-process job scheduler for Python that…
copyleft · top 15,000 on PyPI
aiojobsaiojobs provides a scheduler for spawning and…
permissive · top 15,000 on PyPI
django-crontabIntegrates system crontab scheduling into…
permissive · top 15,000 on PyPI
django-apschedulerAdds persistent job scheduling to Django…
permissive · top 15,000 on PyPI
streamlit-autorefreshAdds a frontend timer to Streamlit apps that…
unclear · top 15,000 on PyPI
Flask-APSchedulerFlask-APScheduler integrates APScheduler with…
permissive · top 15,000 on PyPI
openjd-sessionsProvides a runtime library for executing Open…
permissive · top 15,000 on PyPI