Skip to main content
https://secure.travis-ci.org/lukaszb/monolith.png?branch=master

Monolith

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 https://monolith.readthedocs.org/en/latest/.

Example

#!/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,
    })
    manager.execute()

if __name__ == '__main__':
    main()

Metadata

Release files for monolith 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for monolith 0.3.3
File Size Uploaded
monolith-0.3.3.tar.gz 12.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for monolith 0.3.3
File Interpreter ABI Platform
monolith-0.3.3-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 41.7 kB

Release files / monolith-0.3.3.tar.gz

Download URL monolith-0.3.3.tar.gz
Size 12.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b4b666401f0b3bb7f460bae63c065d36a926c2493e87cfcedc20a60a2b29463e
BLAKE2b-256 checksum
How to use checksums
3b0af26901f3ed94bd142856255a8ae0e2d701116a913f8349b5bf21d3d068fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / monolith-0.3.3-py2.py3-none-any.whl

Download URL monolith-0.3.3-py2.py3-none-any.whl
Size 29.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
421a0492fa3b58c45d4b87dcc046737f32fbc6a4d872ae84a0f8dd522b9d430a
BLAKE2b-256 checksum
How to use checksums
d5b049fed09aae1b38baf46257a755cf550bb607851dc096042116758de54a39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3.3 This release

2 release files

0.3.2

2 release files

0.3.1

1 release file

0.3.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page