# a-task-queue
Easily create and run tasks (=function calls) with almost seamless transition between Local development and Distributed deployment."
## Usage
```python
from ataskq import TaskQ, Task, targs
from ataskq.tasks_utils import hello_world, dummy_args_task
def hello_world():
print("hello world")
def task_with_args(*args, **kwargs):
print(f"task_with_args args: {args}, kwargs: {kwargs}")
# create job
tr = TaskQ().create_job()
# add tasks
# add tasks (functions to run)
tr.add_tasks(
[
Task(entrypoint=hello_world),
Task(entrypoint=task_with_args, targs=targs("arg0", "arg1", kwarg1=10, kwarg2="this is kwarg2")),
]
)
# run the tasks
tr.run() # to run in parallel add concurrency=N
```
more example can be found [here](./examples)
## Contributer
to setup project run
```
./contrib/setup.sh
```
### vs code
to get nominal vscode settings run
```
./contrib/.vscode/init.sh
```
Raw data
{
"_id": null,
"home_page": null,
"name": "ataskq",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "python, task, queue, distributed systems, distributed computing",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/8e/8e/83d2a8a1ff2385ffcf9d99d44b89890f98749396fd6961fc4f9fb7aa1c2e/ataskq-0.6.5.tar.gz",
"platform": null,
"description": "# a-task-queue\nEasily create and run tasks (=function calls) with almost seamless transition between Local development and Distributed deployment.\"\n\n## Usage\n```python\nfrom ataskq import TaskQ, Task, targs\nfrom ataskq.tasks_utils import hello_world, dummy_args_task\n\n\ndef hello_world():\n print(\"hello world\")\n\n\ndef task_with_args(*args, **kwargs):\n print(f\"task_with_args args: {args}, kwargs: {kwargs}\")\n\n\n# create job\ntr = TaskQ().create_job()\n\n# add tasks\n# add tasks (functions to run)\ntr.add_tasks(\n [\n Task(entrypoint=hello_world),\n Task(entrypoint=task_with_args, targs=targs(\"arg0\", \"arg1\", kwarg1=10, kwarg2=\"this is kwarg2\")),\n ]\n)\n\n# run the tasks\ntr.run() # to run in parallel add concurrency=N\n```\n\nmore example can be found [here](./examples)\n\n## Contributer\nto setup project run\n```\n./contrib/setup.sh\n```\n\n### vs code\nto get nominal vscode settings run\n```\n./contrib/.vscode/init.sh\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Easily create and run tasks (=function calls) with almost seamless transition between Local development and Distributed deployment.",
"version": "0.6.5",
"project_urls": {
"Homepage": "https://github.com/innoviz-swt/a-task-queue",
"Issues": "https://github.com/innoviz-swt/a-task-queue/issues"
},
"split_keywords": [
"python",
" task",
" queue",
" distributed systems",
" distributed computing"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "afade77a87325b2327fcb1f378f3926befca28ea5b7c640dcf567728757a575c",
"md5": "d4b41718aea9bbc7b244f82b102b8a35",
"sha256": "f7da88ea902dab1ce63e150ae3485fc9a2308224597874ebec909813dfe5b77d"
},
"downloads": -1,
"filename": "ataskq-0.6.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d4b41718aea9bbc7b244f82b102b8a35",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 76219,
"upload_time": "2024-06-27T18:44:16",
"upload_time_iso_8601": "2024-06-27T18:44:16.302255Z",
"url": "https://files.pythonhosted.org/packages/af/ad/e77a87325b2327fcb1f378f3926befca28ea5b7c640dcf567728757a575c/ataskq-0.6.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8e8e83d2a8a1ff2385ffcf9d99d44b89890f98749396fd6961fc4f9fb7aa1c2e",
"md5": "8bed2854aae752aeafbd017ed67d264d",
"sha256": "3d779245c00fb4bee524b4db0adcb2fd0f346a3ecce66654df6529e95ed0906c"
},
"downloads": -1,
"filename": "ataskq-0.6.5.tar.gz",
"has_sig": false,
"md5_digest": "8bed2854aae752aeafbd017ed67d264d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 64486,
"upload_time": "2024-06-27T18:44:17",
"upload_time_iso_8601": "2024-06-27T18:44:17.984440Z",
"url": "https://files.pythonhosted.org/packages/8e/8e/83d2a8a1ff2385ffcf9d99d44b89890f98749396fd6961fc4f9fb7aa1c2e/ataskq-0.6.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-27 18:44:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "innoviz-swt",
"github_project": "a-task-queue",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "annotated-types",
"specs": [
[
"==",
"0.7.0"
]
]
},
{
"name": "anyio",
"specs": [
[
"==",
"4.4.0"
]
]
},
{
"name": "certifi",
"specs": [
[
"==",
"2024.6.2"
]
]
},
{
"name": "cfgv",
"specs": [
[
"==",
"3.4.0"
]
]
},
{
"name": "charset-normalizer",
"specs": [
[
"==",
"3.3.2"
]
]
},
{
"name": "click",
"specs": [
[
"==",
"8.1.7"
]
]
},
{
"name": "distlib",
"specs": [
[
"==",
"0.3.8"
]
]
},
{
"name": "dnspython",
"specs": [
[
"==",
"2.6.1"
]
]
},
{
"name": "email_validator",
"specs": [
[
"==",
"2.1.1"
]
]
},
{
"name": "exceptiongroup",
"specs": [
[
"==",
"1.2.1"
]
]
},
{
"name": "fastapi",
"specs": [
[
"==",
"0.111.0"
]
]
},
{
"name": "fastapi-cli",
"specs": [
[
"==",
"0.0.4"
]
]
},
{
"name": "filelock",
"specs": [
[
"==",
"3.14.0"
]
]
},
{
"name": "h11",
"specs": [
[
"==",
"0.14.0"
]
]
},
{
"name": "httpcore",
"specs": [
[
"==",
"1.0.5"
]
]
},
{
"name": "httptools",
"specs": [
[
"==",
"0.6.1"
]
]
},
{
"name": "httpx",
"specs": [
[
"==",
"0.27.0"
]
]
},
{
"name": "identify",
"specs": [
[
"==",
"2.5.36"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"3.7"
]
]
},
{
"name": "iniconfig",
"specs": [
[
"==",
"2.0.0"
]
]
},
{
"name": "Jinja2",
"specs": [
[
"==",
"3.1.4"
]
]
},
{
"name": "markdown-it-py",
"specs": [
[
"==",
"3.0.0"
]
]
},
{
"name": "MarkupSafe",
"specs": [
[
"==",
"2.1.5"
]
]
},
{
"name": "mdurl",
"specs": [
[
"==",
"0.1.2"
]
]
},
{
"name": "nodeenv",
"specs": [
[
"==",
"1.9.1"
]
]
},
{
"name": "orjson",
"specs": [
[
"==",
"3.10.3"
]
]
},
{
"name": "packaging",
"specs": [
[
"==",
"24.0"
]
]
},
{
"name": "platformdirs",
"specs": [
[
"==",
"4.2.2"
]
]
},
{
"name": "pluggy",
"specs": [
[
"==",
"1.5.0"
]
]
},
{
"name": "pre-commit",
"specs": [
[
"==",
"3.5.0"
]
]
},
{
"name": "psycopg2-binary",
"specs": [
[
"==",
"2.9.9"
]
]
},
{
"name": "pydantic",
"specs": [
[
"==",
"2.7.3"
]
]
},
{
"name": "pydantic_core",
"specs": [
[
"==",
"2.18.4"
]
]
},
{
"name": "Pygments",
"specs": [
[
"==",
"2.18.0"
]
]
},
{
"name": "pytest",
"specs": [
[
"==",
"8.2.2"
]
]
},
{
"name": "python-dotenv",
"specs": [
[
"==",
"1.0.1"
]
]
},
{
"name": "python-multipart",
"specs": [
[
"==",
"0.0.9"
]
]
},
{
"name": "PyYAML",
"specs": [
[
"==",
"6.0.1"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.32.3"
]
]
},
{
"name": "rich",
"specs": [
[
"==",
"13.7.1"
]
]
},
{
"name": "shellingham",
"specs": [
[
"==",
"1.5.4"
]
]
},
{
"name": "sniffio",
"specs": [
[
"==",
"1.3.1"
]
]
},
{
"name": "starlette",
"specs": [
[
"==",
"0.37.2"
]
]
},
{
"name": "tomli",
"specs": [
[
"==",
"2.0.1"
]
]
},
{
"name": "typer",
"specs": [
[
"==",
"0.12.3"
]
]
},
{
"name": "typing_extensions",
"specs": [
[
"==",
"4.12.1"
]
]
},
{
"name": "ujson",
"specs": [
[
"==",
"5.10.0"
]
]
},
{
"name": "urllib3",
"specs": [
[
"==",
"2.2.1"
]
]
},
{
"name": "uvicorn",
"specs": [
[
"==",
"0.30.1"
]
]
},
{
"name": "uvloop",
"specs": [
[
"==",
"0.19.0"
]
]
},
{
"name": "virtualenv",
"specs": [
[
"==",
"20.26.2"
]
]
},
{
"name": "watchfiles",
"specs": [
[
"==",
"0.22.0"
]
]
},
{
"name": "websockets",
"specs": [
[
"==",
"12.0"
]
]
}
],
"lcname": "ataskq"
}