Simple in-process task scheduler for Python apps
Project description
JustScheduleIt
Simple in-process task scheduler for Python apps.
Use it if:
- you need to schedule background tasks in the same process, like to update a shared dataframe every hour from S3
Take something else if:
- you need to schedule persistent/distributed tasks, that should be executed in a separate process (take a look at Celery)
Usage
Just schedule a task
from datetime import timedelta
from justscheduleit import Scheduler, every, run
scheduler = Scheduler()
@scheduler.task(every(timedelta(minutes=1), delay=(0, 10)))
def task():
print("Hello, world!")
run(scheduler)
sync
and async
tasks
The scheduler supports both sync
and async
functions. A sync
function will be executed in a separate thread,
using
anyio.to_thread.run_sync()
,
so it won't block the scheduler (other tasks).
(Advanced) Hosting
Scheduler is built around Host abstraction. A host is a supervisor that runs 1 or more services, usually as the application entry point.
A scheduler itself is a hosted service. The default justscheduleit.run()
internally just creates a host with one
service, the passed scheduler, and runs it.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file justscheduleit-0.2.0.tar.gz
.
File metadata
- Download URL: justscheduleit-0.2.0.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.19.1 CPython/3.12.6 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac74817f28b9d6e004c1b247b589a35608c3e97a7c5181e5b13deb6484b5e760 |
|
MD5 | 86ce4f7f23e5d1c904a3e944ef0dc7dc |
|
BLAKE2b-256 | 2bc58dfa6c9c9b84ddbe3ecd31f4f1d829f6284445b96b9eba1e79a3c0620465 |
File details
Details for the file justscheduleit-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: justscheduleit-0.2.0-py3-none-any.whl
- Upload date:
- Size: 21.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.19.1 CPython/3.12.6 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b564efc093e3b349c83f5b6c83e706560edac14d6eeb90c853a0c7f92d37fb7 |
|
MD5 | 30755292cba6e6086ae02c20d6fe77ff |
|
BLAKE2b-256 | 81e9af050bf56fb440d75be9aae99eab96591047ff11640688e901bfd5438fd0 |