taskpulse
Lightweight background task monitor — live progress bars, ETA, elapsed time, concurrent tasks, callback hooks, and SQLite history. No Celery, no Redis, pure Python.
Installation
pip install taskpulse
No dependencies. Requires Python 3.8+.
Quick Start
from taskpulse import TaskPulse
pulse = TaskPulse()
@pulse.task(name="Process files", total=100)
def process(task):
for i in range(100):
do_work()
task.update(i + 1)
return "done"
t = pulse.run(process)
pulse.wait(t.id)
print(t.result) # "done"
Terminal output:
⚡ Process files [████████████░░░░░░░░░░░░░░░░░░] 41.0% elapsed 2.1s ETA 3.0s
✅ Process files [done] elapsed 5.1s
Usage
Define Tasks
# Decorator style
@pulse.task(name="My Task", total=50)
def my_task(task):
for i in range(50):
process_item(i)
task.update(i + 1) # report progress
return "finished"
# Run it
t = pulse.run(my_task)
# Inline (no decorator)
def simple(task, items):
for i, item in enumerate(items):
process(item)
task.update(i + 1, total=len(items))
return len(items)
t = pulse.run(simple, my_items, name="Process items")
Progress Updates
def fn(task):
task.update(5) # just update progress
task.update(10, total=50) # also update total
Concurrent Tasks
tasks = [pulse.run(process, batch) for batch in batches]
pulse.wait(*[t.id for t in tasks]) # wait for all
Hooks
def on_start(task):
print(f"Starting: {task.name}")
def on_progress(task):
if task.percent and task.percent > 50:
notify_team("halfway done")
def on_done(task):
send_email(f"Task complete: {task.result}")
def on_error(task):
alert(f"Task failed: {task.error}")
@pulse.task(
name="Important Job",
on_start=on_start,
on_progress=on_progress,
on_done=on_done,
on_error=on_error,
)
def important_job(task):
...
Task Status
task = pulse.get("task-0001")
print(task.status) # TaskStatus.RUNNING
print(task.percent) # 42.0
print(task.elapsed) # 3.2 (seconds)
print(task.eta) # 4.4 (seconds remaining)
print(task.result) # None while running
print(task.error) # None if no error
Live Dashboard
from taskpulse import TaskPulse
from taskpulse import Monitor
pulse = TaskPulse(show_progress=False)
monitor = Monitor(pulse, refresh=0.5)
monitor.start()
for batch in batches:
pulse.run(process, batch)
pulse.wait()
monitor.stop()
SQLite History
# Full run history persisted across restarts
history = pulse.history(limit=20)
for run in history:
print(run["name"], run["status"], run["elapsed"])
API Reference
TaskPulse
TaskPulse(
db_path="taskpulse.db", # SQLite history file
max_workers=4, # Max concurrent tasks
show_progress=True, # Live progress bars
)
| Method | Description |
|---|---|
task(name, total, on_start, ...) |
Decorator to define a task |
run(func, *args, **kwargs) |
Submit task, returns Task immediately |
wait(*task_ids, timeout) |
Block until tasks complete |
get(task_id) |
Get Task by ID |
all_tasks() |
List all Task objects |
status() |
List of status dicts |
history(limit) |
Run history from SQLite |
print_status() |
Print formatted table |
cancel(task_id) |
Cancel a pending task |
Task
| Attribute | Type | Description |
|---|---|---|
id |
str |
Unique task ID |
name |
str |
Task name |
status |
TaskStatus |
pending/running/done/failed/cancelled |
progress |
int |
Current step count |
total |
int | None |
Total steps |
percent |
float | None |
0-100 |
elapsed |
float |
Seconds since start |
eta |
float | None |
Estimated seconds remaining |
result |
Any |
Return value (when done) |
error |
str | None |
Traceback (when failed) |
Running Tests
pip install pytest
pytest tests/ -v
License
MIT © prabhay759
Metadata
Release files for taskpulse 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| taskpulse-1.0.0.tar.gz | 11.6 kB | With provenance | Details for taskpulse-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| taskpulse-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for taskpulse-1.0.0-py3-none-any.whl |
Total release size: 21.3 kB
Release files / taskpulse-1.0.0.tar.gz
| Download URL | taskpulse-1.0.0.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f31dc0c0e9d25478209cb7d8b777fa53dc0fdd2ff72dd550576b9ba07641864a
|
|
BLAKE2b-256 checksum How to use checksums |
2b6fc24ea51939dcb4c04536ec25367dcc1f304815876c3506f313703efe6216
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 3, 2026.
Transparency logRelease files / taskpulse-1.0.0-py3-none-any.whl
| Download URL | taskpulse-1.0.0-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
586e75453cc672f28293972868db492e75fe9168fd97d62e79f4058dd9a78713
|
|
BLAKE2b-256 checksum How to use checksums |
83d99786585cf1648959e9cea5c1d1f2bcf9750574fcad785525e024a697bf25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 3, 2026.
Transparency logSecurity for taskpulse 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for taskpulse-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.