Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

Incredibly simple YAML-based task runner.

Project Description

M-O
===

Incredibly simple YAML-based tool for *[STRIKEOUT:removing foreign
contaminants]* running tasks.

.. figure:: https://github.com/thomasleese/mo/raw/master/assets/screenshot.png
:alt: Screenshot

Screenshot

Installation
------------

.. code:: sh

pip install mo

Running Tests
-------------

Just to demonstrate how much ``M-O`` will improve your life:

Before
^^^^^^

.. code:: sh

git clone https://github.com/thomasleese/mo.git
pyvenv venv
pip install -r requirements.txt
pip install -e .
python setup.py test

After
^^^^^

.. code:: sh

git clone https://github.com/thomasleese/mo.git
python -m mo test

The ```M-O`` configuration
file <https://github.com/thomasleese/mo/blob/master/mo.yaml#L19>`__ for
this repository defines a ``test`` task which does the commands above.

Configuration
-------------

``M-O`` is configured using a YAML file, typically called ``mo.yaml``.

Tasks
~~~~~

An example task might be:

.. code:: yaml

tasks:
hello:
description: Say hello.
command: echo hello

Tasks can also depend on each other, like this:

.. code:: yaml

tasks:
hello:
description: Say hello.
command: echo hello

bye:
description: Say bye.
command: echo bye
after:
- hello

Variables
~~~~~~~~~

Each task command can contain variables using the `Jinja2 template
language <http://jinja.pocoo.org/docs/>`__. First you declare the
variables you want available:

.. code:: yaml

variables:
greeting:
description: The greeting.
default: hello

Next you can use the variable in your tasks:

.. code:: yaml

tasks:
greet:
description: Say a greeting.
command: echo {{ greeting }}

To change the greeting, you would invoke ``M-O`` like this:

.. code:: sh

mo greet -v greeting=howdy

Usage
-----

To run a task, it's a simple as running:

.. code:: sh

mo hello

To get a list of all available tasks, you can just run:

.. code:: sh

mo

Every ``M-O`` configuration file comes with a built-in ``help`` task
which can be used to find out more information about other tasks:

.. code:: sh

mo help hello

I/O
---

One unique feature of ``M-O`` is that it supports a number of different
input/output schemes, two at the moment.

- ``human`` is the default scheme and it displays colourful,
well-formatted output through standard out.
- ``json`` is an alternative scheme which sends JSON objects via
standard output containing all the information required to display a
suitable output to the user. The idea behind the ``json`` scheme is
that IDEs and other tools will be able to easily integrate ``M-O``
support into their software without having to understand ``mo.yaml``
files.

To change the scheme ``M-O`` uses, you can use the ``--io`` flag.

Release History

This version
History Node

0.1.0

Download Files

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

File Name & Hash SHA256 Hash Help Version File Type Upload Date
mo-0.1.0-py2.py3-none-any.whl
(8.6 kB) Copy SHA256 Hash SHA256
3.5 Wheel Feb 17, 2016
mo-0.1.0.tar.gz
(5.8 kB) Copy SHA256 Hash SHA256
Source Feb 17, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting