# TaskShed
A high-performance, asynchronous, ready for production job scheduling framework.
TaskShed provides a simple API to schedule your Python coroutines for later execution. You can run tasks just once or on a recurring interval. The scheduler is dynamic, allowing you to add, update or remove tasks on the fly. Furthermore, by connecting to a persistent datastore, TaskShed ensures your tasks survive restarts and automatically catches up on any executions that were missed while the system was offline.
The key features are:
* **Fast**: TaskShed has a [very low latency, overhead and can execute several thousands tasks a second](https://chase-labs.github.io/taskshed/benchmarks/).
* **Distributed**: TaskShed has the capacity to spawn several workers and schedules across many machines, while also providing optimisation for monolinth architectures.
* **Persistant**: Tasks are stored in database, meaning that they won't get dropped on shutdown. TaskShed currently supports Redis and MySQL.
* **Easy**: TaskShed's modular architecture is straightforward and easy to set-up, and works in any asynchronous environement.
# Installation 🔧
Install the core package using pip:
```sh
pip install taskshed
```
TaskShed has no extra dependencies beyond its core framework. However, if you want **persistent task storage**, you’ll need to install one of the optional backends. TaskShed currently supports [Redis](https://redis.io/) and [MySQL](https://www.mysql.com/). You can install the appropriate driver using:
```shs
pip install "taskshed[redis]"
```
or
```sh
pip install "taskshed[mysql]"
```
# Quick Start 🏁
Here's a simple example of scheduling a task to run in 5 seconds.
```py
from datetime import datetime, timedelta
from taskshed.datastores import InMemoryDataStore
from taskshed.schedulers import AsyncScheduler
from taskshed.workers import EventDrivenWorker
async def say_hello(name: str):
print(f"Hello, {name}!")
datastore = InMemoryDataStore()
worker = EventDrivenWorker(callback_map={"say_hello": say_hello}, datastore=datastore)
scheduler = AsyncScheduler(datastore=datastore, worker=worker)
async def main():
await scheduler.start()
await worker.start()
await scheduler.add_task(
callback="say_hello",
run_at=datetime.now() + timedelta(seconds=3),
kwargs={"name": "World"},
)
if __name__ == "__main__":
import asyncio
loop = asyncio.new_event_loop()
loop.create_task(main())
loop.run_forever()
```
# Documentation 📚
https://chase-labs.github.io/taskshed/
# Contributing 🤝
Contributions are welcome! Please feel free to submit a pull request or open an issue.
# License 📜
This project is licensed under the MIT License.
Raw data
{
"_id": null,
"home_page": null,
"name": "taskshed",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "task scheduling, job scheduling, scheduler, cron, background jobs, background tasks, periodic tasks, recurring tasks, asyncio, asynchronous, distributed, worker, queue, redis, mysql",
"author": null,
"author_email": "Jacob Strauss <jacob@meetchase.ai>",
"download_url": "https://files.pythonhosted.org/packages/2b/78/cece816cc2ae5ca8e4c240b9184e2517f4cda822b5f4389f6580b14d39d8/taskshed-0.7.0.tar.gz",
"platform": null,
"description": "# TaskShed\n\nA high-performance, asynchronous, ready for production job scheduling framework.\n\nTaskShed provides a simple API to schedule your Python coroutines for later execution. You can run tasks just once or on a recurring interval. The scheduler is dynamic, allowing you to add, update or remove tasks on the fly. Furthermore, by connecting to a persistent datastore, TaskShed ensures your tasks survive restarts and automatically catches up on any executions that were missed while the system was offline.\n\nThe key features are:\n\n* **Fast**: TaskShed has a [very low latency, overhead and can execute several thousands tasks a second](https://chase-labs.github.io/taskshed/benchmarks/).\n* **Distributed**: TaskShed has the capacity to spawn several workers and schedules across many machines, while also providing optimisation for monolinth architectures.\n* **Persistant**: Tasks are stored in database, meaning that they won't get dropped on shutdown. TaskShed currently supports Redis and MySQL.\n* **Easy**: TaskShed's modular architecture is straightforward and easy to set-up, and works in any asynchronous environement.\n\n\n# Installation \ud83d\udd27\n\nInstall the core package using pip:\n\n```sh\npip install taskshed\n```\n\nTaskShed has no extra dependencies beyond its core framework. However, if you want **persistent task storage**, you\u2019ll need to install one of the optional backends. TaskShed currently supports [Redis](https://redis.io/) and [MySQL](https://www.mysql.com/). You can install the appropriate driver using:\n\n```shs\npip install \"taskshed[redis]\"\n```\n\nor\n\n```sh\npip install \"taskshed[mysql]\"\n```\n\n# Quick Start \ud83c\udfc1\n\nHere's a simple example of scheduling a task to run in 5 seconds.\n\n```py\nfrom datetime import datetime, timedelta\nfrom taskshed.datastores import InMemoryDataStore\nfrom taskshed.schedulers import AsyncScheduler\nfrom taskshed.workers import EventDrivenWorker\n\n\nasync def say_hello(name: str):\n print(f\"Hello, {name}!\")\n\n\ndatastore = InMemoryDataStore()\nworker = EventDrivenWorker(callback_map={\"say_hello\": say_hello}, datastore=datastore)\nscheduler = AsyncScheduler(datastore=datastore, worker=worker)\n\n\nasync def main():\n await scheduler.start()\n await worker.start()\n await scheduler.add_task(\n callback=\"say_hello\",\n run_at=datetime.now() + timedelta(seconds=3),\n kwargs={\"name\": \"World\"},\n )\n\n\nif __name__ == \"__main__\":\n import asyncio\n\n loop = asyncio.new_event_loop()\n loop.create_task(main())\n loop.run_forever()\n```\n\n# Documentation \ud83d\udcda\n\nhttps://chase-labs.github.io/taskshed/\n\n# Contributing \ud83e\udd1d\n\nContributions are welcome! Please feel free to submit a pull request or open an issue.\n\n# License \ud83d\udcdc\n\nThis project is licensed under the MIT License.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A high-performance, asynchronous, ready for production task scheduling framework written in Python.",
"version": "0.7.0",
"project_urls": {
"Bug Tracker": "https://github.com/Chase-Labs/taskshed/issues",
"Documentation": "https://chase-labs.github.io/taskshed/",
"Homepage": "https://github.com/Chase-Labs/taskshed"
},
"split_keywords": [
"task scheduling",
" job scheduling",
" scheduler",
" cron",
" background jobs",
" background tasks",
" periodic tasks",
" recurring tasks",
" asyncio",
" asynchronous",
" distributed",
" worker",
" queue",
" redis",
" mysql"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "7ff4277ae7a1eb8b1489780c0c7d16866c8c3bed05869486798dfd7aeb9bd8c8",
"md5": "e9fb45dbe82043d008c705ffc692a3e8",
"sha256": "2dd621178605836df60ca1810f88769bcbea8a5ff32bf6b28a85e4f1aa81ef01"
},
"downloads": -1,
"filename": "taskshed-0.7.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e9fb45dbe82043d008c705ffc692a3e8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 21260,
"upload_time": "2025-08-16T07:10:35",
"upload_time_iso_8601": "2025-08-16T07:10:35.769132Z",
"url": "https://files.pythonhosted.org/packages/7f/f4/277ae7a1eb8b1489780c0c7d16866c8c3bed05869486798dfd7aeb9bd8c8/taskshed-0.7.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "2b78cece816cc2ae5ca8e4c240b9184e2517f4cda822b5f4389f6580b14d39d8",
"md5": "cd09a17c094a1556411c448ed3a8491c",
"sha256": "fa6a56831c18a2fadc653e218abeb4d53fb7535421be98ca98a897453a154913"
},
"downloads": -1,
"filename": "taskshed-0.7.0.tar.gz",
"has_sig": false,
"md5_digest": "cd09a17c094a1556411c448ed3a8491c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 16746,
"upload_time": "2025-08-16T07:10:36",
"upload_time_iso_8601": "2025-08-16T07:10:36.924855Z",
"url": "https://files.pythonhosted.org/packages/2b/78/cece816cc2ae5ca8e4c240b9184e2517f4cda822b5f4389f6580b14d39d8/taskshed-0.7.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-16 07:10:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Chase-Labs",
"github_project": "taskshed",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "taskshed"
}