Getting StartedΒΆ

Creating your first helper application is a fairly straightforward process:

  1. Download and install helper via pip:

    pip install helper
  2. Create a new application with the new-helper script which will create a stub project including the package directory, configuration file, init.d script for RHEL systems, and file:

    new-helper -p myapp
  3. Open the file in myapp/myapp/ and you should have a file that looks similar to the following:

    Helper boilerplate project
    import helper
    import logging
    from helper import parser
    DESCRIPTION = 'Project Description'
    LOGGER = logging.getLogger(__name__)
    class Controller(helper.Controller):
        """The core application controller which is created by invoking
        def setup(self):
            """Place setup and initialization steps in this method."""
  'setup invoked')
        def process(self):
            """This method is invoked every wake interval as specified in the
            application configuration. It is fully wrapped and you do not need to
            manage state within it.
  'process invoked')
        def cleanup(self):
            """Place shutdown steps in this method."""
  'cleanup invoked')
    def main():
  4. Extend the Controller.proccess method to put your core logic in place.

  5. If you want to test your app without installing it, I often make a small script in the project directory, something like myapp/ that looks like the following:

    from myapp import controller
  6. Change the mode of the file to u+x and run it:

    chmod u+x
    ./ -c etc/myapp.yml -f

That’s about all there is to it. If you don’t want to use the sleep/wake/process pattern but want to use an IOLoop, instead of extending Controller.process, extend

Project Versions

Previous topic

Application Initialization Tool

Next topic

Configuration Format

This Page