quickie.factories

Factories for creating tasks from functions.

We can create tasks from functions using the task, script, and command decorators. Additionally, we can add arguments to the tasks using the arg decorator.

@task(
    name="hello"
    args=[
        Arg("number1", type=int, help="The first number."),
        Arg("number2", type=int, help="The second number."),
    ]
)
def sum(number1, number2):
    console.print(f"The sum is {number1 + number2}.")

@script(args=["--name"])
def sum(name="world"):
    """Docstring will be used as help text."""
    return f"echo Hello, {name}!"

@command
def compose():
    return ["docker", "compose", "up"]

Functions

command()

Create a command task from a function.

group()

Create a group task from a function.

script()

Create a script from a function.

task()

Create a task from a function.

task_factory_helper()

Create a task class from a function.

thread_group()

Create a thread group task from a function.

Classes

CommonTaskKwargs

Common keyword arguments for task decorators.