Name | quickie-runner JSON |
Version |
0.4.0
JSON |
| download |
home_page | None |
Summary | A CLI tool for quick tasks. |
upload_time | 2024-12-19 21:16:14 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.12 |
license | The MIT License Copyright 2024 Adrian Martinez Rodriguez <adrianmrit@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
cli
quick
tasks
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Quickie - A CLI tool for quick tasks
[![License](https://img.shields.io/github/license/adrianmrit/quickie)](https://github.com/adrianmrit/quickie/blob/master/LICENSE)
## Getting Started
### Installing
Quickie can be installed either on a per-project basis and globally.
For projects it is recommended to use a virtual environment and install via `pip`:
```sh
python -m venv .venv
source .venv/bin/activate
pip install quickie-runner
qk --help
```
For global installation, you can install `quickie-runner-global` instead. It will add
`quickie-runner` as a dependency, but also add a `qkg` executable, which will run global
tasks by default. This allows us to run our global tasks from any project without conflicts.
For global installation it is recommended to use `pipx`, as it will install it in an isolated
environment:
```sh
pipx install quickie-runner-global
qkg --help
```
If you have any issues with the `quickie` package missing when running `qkg`, you can inject it manually:
```sh
pipx inject quickie-runner-global quickie-runner
```
See the [pipx](https://pipx.pypa.io/stable/)
## Tab completion
Tab completion is available for bash and zsh. It depends on the `argcomplete` package, which should have been installed with `quickie`.
To enable tab completion for `quickie`, add the following line to your `.bashrc` or `.zshrc`:
```sh
eval "$(register-python-argcomplete qk)"
eval "$(register-python-argcomplete qkg)"
```
If you get the following error in the zsh shell:
```sh
complete:13: command not found: compdef
```
You can fix it by adding the following line to your `.zshrc` (before the line that registers the completion):
```sh
autoload -Uz compinit && compinit
```
## Usage
Per-project tasks are configured under a `__quickie.py` or `__quickie` python module in the current directory.
If using a `__quickie` directory, the tasks should be defined in the `__quickie/__init__.py` file.
Global tasks on the other hand should be defined in the `Quickie` module in the user's directory.
Tasks are defined as classes, though factory functions are also supported.
### Why define tasks in Python?
While many existing similar tools use YAML, TOML or custom formats to define tasks, `quickie` uses Python for the following reasons:
- Built-in syntax highlighting and linting
- Supported by most editors and IDEs
- Easy to use and understand
- Extensible and powerful
### Quick Example
Here is a simple example of a `__quickie.py` file:
```python
from quickie import arg, script, task
@task(name=["hello", "greet"])
@arg("name", help="The name to greet")
def hello(name):
"""Greet someone""" # added as the task help
print(f"Hello, {name}!")
@script(extra_args=True)
def echo():
return " ".join(["echo", *args])
```
You can run the `hello` task with the following command:
```sh
$ qk hello world
Hello, world!
$ qk greet world
Hello, world!
```
And the `script` task with:
```sh
$ qk echo Hello there
Hello there
```
Raw data
{
"_id": null,
"home_page": null,
"name": "quickie-runner",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "CLI, quick, tasks",
"author": null,
"author_email": "Adrian Martinez Rodriguez <adrianmrit@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/54/b9/ff9838260f47fbafe8fe978dc5c5effefcf238e643364dbd11a8c9619267/quickie_runner-0.4.0.tar.gz",
"platform": null,
"description": "# Quickie - A CLI tool for quick tasks\n\n[![License](https://img.shields.io/github/license/adrianmrit/quickie)](https://github.com/adrianmrit/quickie/blob/master/LICENSE)\n\n## Getting Started\n\n### Installing\n\nQuickie can be installed either on a per-project basis and globally.\n\nFor projects it is recommended to use a virtual environment and install via `pip`:\n\n```sh\npython -m venv .venv\nsource .venv/bin/activate\npip install quickie-runner\nqk --help\n```\n\nFor global installation, you can install `quickie-runner-global` instead. It will add\n`quickie-runner` as a dependency, but also add a `qkg` executable, which will run global\ntasks by default. This allows us to run our global tasks from any project without conflicts.\n\nFor global installation it is recommended to use `pipx`, as it will install it in an isolated\nenvironment:\n\n```sh\npipx install quickie-runner-global\nqkg --help\n```\n\nIf you have any issues with the `quickie` package missing when running `qkg`, you can inject it manually:\n\n```sh\npipx inject quickie-runner-global quickie-runner\n```\n\nSee the [pipx](https://pipx.pypa.io/stable/)\n\n## Tab completion\n\nTab completion is available for bash and zsh. It depends on the `argcomplete` package, which should have been installed with `quickie`.\n\nTo enable tab completion for `quickie`, add the following line to your `.bashrc` or `.zshrc`:\n\n```sh\neval \"$(register-python-argcomplete qk)\"\neval \"$(register-python-argcomplete qkg)\"\n```\n\nIf you get the following error in the zsh shell:\n\n```sh\ncomplete:13: command not found: compdef\n```\n\nYou can fix it by adding the following line to your `.zshrc` (before the line that registers the completion):\n\n```sh\nautoload -Uz compinit && compinit\n```\n\n## Usage\n\nPer-project tasks are configured under a `__quickie.py` or `__quickie` python module in the current directory.\nIf using a `__quickie` directory, the tasks should be defined in the `__quickie/__init__.py` file.\n\nGlobal tasks on the other hand should be defined in the `Quickie` module in the user's directory.\n\nTasks are defined as classes, though factory functions are also supported.\n\n### Why define tasks in Python?\n\nWhile many existing similar tools use YAML, TOML or custom formats to define tasks, `quickie` uses Python for the following reasons:\n\n- Built-in syntax highlighting and linting\n- Supported by most editors and IDEs\n- Easy to use and understand\n- Extensible and powerful\n\n### Quick Example\n\nHere is a simple example of a `__quickie.py` file:\n\n```python\nfrom quickie import arg, script, task\n\n@task(name=[\"hello\", \"greet\"])\n@arg(\"name\", help=\"The name to greet\")\ndef hello(name):\n \"\"\"Greet someone\"\"\" # added as the task help\n print(f\"Hello, {name}!\")\n\n\n@script(extra_args=True)\ndef echo():\n return \" \".join([\"echo\", *args])\n```\n\nYou can run the `hello` task with the following command:\n\n```sh\n$ qk hello world\nHello, world!\n$ qk greet world\nHello, world!\n```\n\nAnd the `script` task with:\n\n```sh\n$ qk echo Hello there\nHello there\n```\n",
"bugtrack_url": null,
"license": "The MIT License Copyright 2024 Adrian Martinez Rodriguez <adrianmrit@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "A CLI tool for quick tasks.",
"version": "0.4.0",
"project_urls": {
"Changelog": "https://github.com/adrianmrit/quickie/blob/main/CHANGELOG.md",
"Documentation": "https://quickie.readthedocs.io",
"Homepage": "https://github.com/adrianmrit/quickie",
"Issues": "https://github.com/adrianmrit/quickie/issues",
"Repository": "https://github.com/adrianmrit/quickie.git"
},
"split_keywords": [
"cli",
" quick",
" tasks"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d1499a07aff58c9efb6056c5094928a0858b304dd135a61b52120469eb6d5a91",
"md5": "04905900156707b99d28831f51d3c7f6",
"sha256": "8fb5cfef9744f4751e7e11c919c3ff56ff749919c9afecf90fbdc7f521ea8bac"
},
"downloads": -1,
"filename": "quickie_runner-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "04905900156707b99d28831f51d3c7f6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 31860,
"upload_time": "2024-12-19T21:16:11",
"upload_time_iso_8601": "2024-12-19T21:16:11.758562Z",
"url": "https://files.pythonhosted.org/packages/d1/49/9a07aff58c9efb6056c5094928a0858b304dd135a61b52120469eb6d5a91/quickie_runner-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "54b9ff9838260f47fbafe8fe978dc5c5effefcf238e643364dbd11a8c9619267",
"md5": "579da1f2dae2b186ee963a93294cc560",
"sha256": "afaa7e474b600e22348aa92aa7d50626c54eb9bcc1f3833dfb1711f3e4eeff96"
},
"downloads": -1,
"filename": "quickie_runner-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "579da1f2dae2b186ee963a93294cc560",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 46154,
"upload_time": "2024-12-19T21:16:14",
"upload_time_iso_8601": "2024-12-19T21:16:14.920889Z",
"url": "https://files.pythonhosted.org/packages/54/b9/ff9838260f47fbafe8fe978dc5c5effefcf238e643364dbd11a8c9619267/quickie_runner-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-19 21:16:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "adrianmrit",
"github_project": "quickie",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "quickie-runner"
}