Skip to main content

monolith is an argparse based command line interface framework

Project description


monolith is simple framwork for creating command line tools. Subcommands are class based (approach and part of implementation was inspired by Django management commands, however monolith uses argparse instead of optparse).

Supported Python versions are 2.6/2.7, 3.2+ and PyPy.

Latest documentation can be found at


#!/usr/bin/env python
Example of how to create git-like execution manager with monolith.
This is completely fake command.
from __future__ import print_function
from monolith.cli import SimpleExecutionManager
from monolith.cli import BaseCommand
from monolith.cli import LabelCommand
from monolith.cli import arg

class AddCommand(LabelCommand):

    def handle_label(self, label, namespace):
        print("A %s" % label)

class CommitCommand(BaseCommand):
    args = BaseCommand.args + [
        arg('-a', '--add', action='store_true', default=False),
        arg('-m', '--message', help="Commit's message", required=True),

    def handle(self, namespace):
        print('Commit message: %r' % namespace.message)
        if namespace.add:
            print(' * add switch given!')

def main():
    manager = SimpleExecutionManager('mygit', commands={
        'add': AddCommand,
        'commit': CommitCommand,

if __name__ == '__main__':

Project details

Download files

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

Files for monolith, version 0.3.3
Filename, size File type Python version Upload date Hashes
Filename, size monolith-0.3.3-py2.py3-none-any.whl (29.6 kB) File type Wheel Python version 3.3 Upload date Hashes View
Filename, size monolith-0.3.3.tar.gz (12.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page