# 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
```python
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()`](https://anyio.readthedocs.io/en/stable/threads.html#running-a-function-in-a-worker-thread),
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.
Raw data
{
"_id": null,
"home_page": "https://github.com/alexeyshockov/justscheduleit",
"name": "justscheduleit",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "scheduler, cron",
"author": "Alexey Shokov",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/2b/c5/8dfa6c9c9b84ddbe3ecd31f4f1d829f6284445b96b9eba1e79a3c0620465/justscheduleit-0.2.0.tar.gz",
"platform": null,
"description": "# JustScheduleIt\n\nSimple in-process task scheduler for Python apps.\n\nUse it if:\n\n- you need to schedule background tasks in the same process, like to update a shared dataframe every hour\n from S3\n\nTake something else if:\n\n- you need to schedule persistent/distributed tasks, that should be executed in a separate process (take a look at\n Celery)\n\n## Usage\n\n### Just schedule a task\n\n```python\nfrom datetime import timedelta\n\nfrom justscheduleit import Scheduler, every, run\n\nscheduler = Scheduler()\n\n\n@scheduler.task(every(timedelta(minutes=1), delay=(0, 10)))\ndef task():\n print(\"Hello, world!\")\n\n\nrun(scheduler)\n```\n\n### `sync` and `async` tasks\n\nThe scheduler supports both `sync` and `async` functions. A `sync` function will be executed in a separate thread,\nusing [\n`anyio.to_thread.run_sync()`](https://anyio.readthedocs.io/en/stable/threads.html#running-a-function-in-a-worker-thread),\nso it won't block the scheduler (other tasks).\n\n### (Advanced) Hosting\n\nScheduler is built around Host abstraction. A host is a supervisor that runs 1 or more services, usually as the\napplication entry point.\n\nA scheduler itself is a hosted service. The default `justscheduleit.run()` internally just creates a host with one\nservice, the passed scheduler, and runs it.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Simple in-process task scheduler for Python apps",
"version": "0.2.0",
"project_urls": {
"Changelog": "https://github.com/alexeyshockov/justscheduleit/blob/main/CHANGELOG.md",
"Docs": "https://alexeyshockov.github.io/justscheduleit/",
"Homepage": "https://github.com/alexeyshockov/justscheduleit"
},
"split_keywords": [
"scheduler",
" cron"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "81e9af050bf56fb440d75be9aae99eab96591047ff11640688e901bfd5438fd0",
"md5": "30755292cba6e6086ae02c20d6fe77ff",
"sha256": "0b564efc093e3b349c83f5b6c83e706560edac14d6eeb90c853a0c7f92d37fb7"
},
"downloads": -1,
"filename": "justscheduleit-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "30755292cba6e6086ae02c20d6fe77ff",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 20957,
"upload_time": "2024-10-03T08:56:17",
"upload_time_iso_8601": "2024-10-03T08:56:17.471201Z",
"url": "https://files.pythonhosted.org/packages/81/e9/af050bf56fb440d75be9aae99eab96591047ff11640688e901bfd5438fd0/justscheduleit-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2bc58dfa6c9c9b84ddbe3ecd31f4f1d829f6284445b96b9eba1e79a3c0620465",
"md5": "86ce4f7f23e5d1c904a3e944ef0dc7dc",
"sha256": "ac74817f28b9d6e004c1b247b589a35608c3e97a7c5181e5b13deb6484b5e760"
},
"downloads": -1,
"filename": "justscheduleit-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "86ce4f7f23e5d1c904a3e944ef0dc7dc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 16959,
"upload_time": "2024-10-03T08:56:18",
"upload_time_iso_8601": "2024-10-03T08:56:18.886334Z",
"url": "https://files.pythonhosted.org/packages/2b/c5/8dfa6c9c9b84ddbe3ecd31f4f1d829f6284445b96b9eba1e79a3c0620465/justscheduleit-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-03 08:56:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "alexeyshockov",
"github_project": "justscheduleit",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "justscheduleit"
}