Skip to main content

A simple Python-based command line tool that is not quite a fully-fledged task runner

Project description

More affectionately known as jogger.

jogger is a simple Python-based command line tool that isn’t quite a fully-fledged task runner. In addition to supporting arbitrary tasks, run either directly on the command line or as Python scripts, it ships with some common, useful, Django-aware tasks that can adapt their behaviour based on which packages are available in the system.

Full documentation at:


Install the latest stable version from PyPI:

pip install task-jogger

Quick start

1. Create

The file, created in the project root directory, stores the tasks defined for the project. It is a regular Python module, the only requirement being that it defines a tasks variable as a dictionary.

2. Define tasks

Keys in the file’s tasks dictionary form each task’s name, and values describe the tasks themselves. At their simplest, a task can be a string defining a command to execute on the command line:

tasks = {
    'hello': 'echo "Hello, World!"',
    'test': 'coverage run python test'

Alternatively, a task can be a Python function that returns a command to execute on the command line. This can be useful if the command is more complex to construct or depends on dynamic values:

def run_tests(settings, stdout, stderr):
    Run the Django test suite, with if installed.

        import coverage
    except ImportError:
        stdout.write('Warning: not installed.', style='warning')
        return 'python test'
        return 'coverage run python test'

tasks = {
    'test': run_tests

Finally, particularly complex tasks can be defined as classes. Such tasks can define their own custom arguments:

from jogger.tasks import Task

class TestTask(Task):

    help = 'Run the Django test suite, with if installed.'

    def add_arguments(self, parser):

            '-q', '--quick',
                'Run a "quick" variant of the task: no coverage analysis and '
                'running tests in parallel.'

    def handle(self, *args, **options):

        command = 'python test'

        if options['quick']:
            command = f'{command} --parallel'
                import coverage
            except ImportError:
                self.stdout.write('Warning: not installed.', style='warning')
                command = f'coverage run {command}'


tasks = {
    'test': TestTask

3. Run jog

The jog command is the interface to the tasks defined in

Given the name of a task, jog will run that task:

$ jog test

If the task accepts arguments, they can also be provided:

$ jog test --quick

Executed with no arguments, jog will display a list of all available tasks. Tasks defined as functions or classes can define a description to be displayed in this listing. Tasks defined as strings simply display the command they will run. The following shows the output of a file containing a mixture of string-based, function-based, and class-based tasks:

$ jog
Available tasks:
string: echo "Hello, World!"
function: A task defined as a function.
class: A task defined as a class.
    See "jog class --help" for usage details

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

task-jogger-1.1.1.tar.gz (24.9 kB view hashes)

Uploaded Source

Built Distribution

task_jogger-1.1.1-py3-none-any.whl (28.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page