# flask-taskx
Flask-TaskX is an extension for [Flask](https://flask.palletsprojects.com/) that adds the capability of running tasks within the context of your Flask applications. If you are familiar with Flask, Flask-TaskX should be easy to pick up. It provides a coherent collection of decorators and tools to define and execute asynchronous tasks.
# Installation
You can install Flask-TaskX with pip:
```
$ pip install flask-taskx
```
or with easy_install:
```
$ easy_install flask-taskx
```
# Quick start
With Flask-TaskX, you define the task worker by instantiating a `BackgroundTaskWorker` and with this instance define all tasks to be executed later in the background.
```python
from flask import Flask
from flask_taskx import BackgroundTaskWorker
app = Flask(__name__)
task_worker = BackgroundTaskWorker(app)
@task_worker.define_task
def email_task(**kwargs):
response = send_message(**kwargs)
return response
@app.route('/email_send')
def email_send():
email_task.apply(email="test@test.com")
task_worker.start()
app.run()
```
# Documentation
The documentation is hosted on [Read the Docs](http://flask-taskx.readthedocs.io/en/latest/)
Raw data
{
"_id": null,
"home_page": "https://github.com/carrasquel/flask-taskx",
"name": "flask-taskx",
"maintainer": "Nelson Carrasquel",
"docs_url": null,
"requires_python": "",
"maintainer_email": "carrasquel@outlook.com",
"keywords": "",
"author": "Nelson Carrasquel",
"author_email": "carrasquel@outlook.com",
"download_url": "https://files.pythonhosted.org/packages/f1/ac/a5f63a172ab743f54f61b02f43ec8b7e8147cc8b48da0fb31082c25257f9/flask-taskx-1.0.tar.gz",
"platform": "any",
"description": "# flask-taskx\r\nFlask-TaskX is an extension for [Flask](https://flask.palletsprojects.com/) that adds the capability of running tasks within the context of your Flask applications. If you are familiar with Flask, Flask-TaskX should be easy to pick up. It provides a coherent collection of decorators and tools to define and execute asynchronous tasks.\r\n\r\n# Installation\r\n\r\nYou can install Flask-TaskX with pip:\r\n\r\n```\r\n$ pip install flask-taskx\r\n```\r\n\r\nor with easy_install:\r\n\r\n```\r\n$ easy_install flask-taskx\r\n```\r\n\r\n# Quick start\r\n\r\nWith Flask-TaskX, you define the task worker by instantiating a `BackgroundTaskWorker` and with this instance define all tasks to be executed later in the background.\r\n\r\n```python\r\nfrom flask import Flask\r\nfrom flask_taskx import BackgroundTaskWorker\r\n\r\napp = Flask(__name__)\r\ntask_worker = BackgroundTaskWorker(app)\r\n\r\n\r\n@task_worker.define_task\r\ndef email_task(**kwargs):\r\n\r\n response = send_message(**kwargs)\r\n return response\r\n\r\n\r\n@app.route('/email_send')\r\ndef email_send():\r\n email_task.apply(email=\"test@test.com\")\r\n\r\ntask_worker.start()\r\napp.run()\r\n```\r\n\r\n# Documentation\r\n\r\nThe documentation is hosted on [Read the Docs](http://flask-taskx.readthedocs.io/en/latest/)\r\n\r\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "A Flask extension for defining and running tasks",
"version": "1.0",
"project_urls": {
"Homepage": "https://github.com/carrasquel/flask-taskx"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8258fb8f1ef88912d76071c8a464e87c844668c16742e38820d6c3da4899a22a",
"md5": "a8c8460c78e8ae9d6cb4103830261d81",
"sha256": "acdc9fbf8a7394ef27a112312e3e044a978ffe6e415a887198d576d075335bab"
},
"downloads": -1,
"filename": "flask_taskx-1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a8c8460c78e8ae9d6cb4103830261d81",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 3118,
"upload_time": "2023-09-24T16:59:20",
"upload_time_iso_8601": "2023-09-24T16:59:20.416641Z",
"url": "https://files.pythonhosted.org/packages/82/58/fb8f1ef88912d76071c8a464e87c844668c16742e38820d6c3da4899a22a/flask_taskx-1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a894f88ae2eef07782797921ed1c40709be7bb45a38745ea2322fb5bd802d08d",
"md5": "a1b02bdf99fd9640e0d7466150bd26cb",
"sha256": "bd3d9c45029a6a2b2e33106c1fcfc539ecb1237a287f3dbf24f69238c9338bc9"
},
"downloads": -1,
"filename": "Flask_TaskX-1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a1b02bdf99fd9640e0d7466150bd26cb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 3119,
"upload_time": "2023-09-24T16:54:44",
"upload_time_iso_8601": "2023-09-24T16:54:44.228365Z",
"url": "https://files.pythonhosted.org/packages/a8/94/f88ae2eef07782797921ed1c40709be7bb45a38745ea2322fb5bd802d08d/Flask_TaskX-1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f1aca5f63a172ab743f54f61b02f43ec8b7e8147cc8b48da0fb31082c25257f9",
"md5": "1fc33f71525fcec3b955ca77918f6acc",
"sha256": "74499e814296adf8c34e2dca8582a2ac397b9a57d17807caf2ed301a485e832d"
},
"downloads": -1,
"filename": "flask-taskx-1.0.tar.gz",
"has_sig": false,
"md5_digest": "1fc33f71525fcec3b955ca77918f6acc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 2378,
"upload_time": "2023-09-24T17:03:48",
"upload_time_iso_8601": "2023-09-24T17:03:48.548291Z",
"url": "https://files.pythonhosted.org/packages/f1/ac/a5f63a172ab743f54f61b02f43ec8b7e8147cc8b48da0fb31082c25257f9/flask-taskx-1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-24 17:03:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "carrasquel",
"github_project": "flask-taskx",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "sphinx",
"specs": [
[
"==",
"7.2.6"
]
]
},
{
"name": "APScheduler",
"specs": [
[
"==",
"3.10.3"
]
]
},
{
"name": "peewee",
"specs": [
[
"==",
"3.16.3"
]
]
},
{
"name": "black",
"specs": [
[
"==",
"23.3.0"
]
]
},
{
"name": "isort",
"specs": [
[
"==",
"5.12.0"
]
]
},
{
"name": "flake8",
"specs": [
[
"==",
"6.0.0"
]
]
},
{
"name": "bandit",
"specs": [
[
"==",
"1.7.5"
]
]
},
{
"name": "Click",
"specs": [
[
"==",
"7.0"
]
]
}
],
"lcname": "flask-taskx"
}