Welcome to decree-tree!

Welcome to decree-tree!#

decree-tree is a package for easily creating nested command-line interfaces (CLIs) using a class-based syntax. It uses Python’s standard argparse library and is part of the Elasmocalc project.

To get started with decree-tree, see the quick start guide. Here’s an example:

from decree_tree import DecreeTree

class Root(DecreeTree):
    def add_arguments(self, parser):
        super().add_arguments(parser)
        parser.add_argument('-v', '--value')

class Echo(DecreeTree):
    def execute(self):
        super().execute()
        print(self.options.value)

class Double(DecreeTree):
    def execute(self):
        super().execute()
        print(self.options.value, self.options.value)

root = Root()
root.add(Echo)
root.add(Double)

if __name__ == '__main__':
    root.run()

Status#

decree-tree is fairly stable, but still in pre-v1.0 development.

Contributing#

To contribute, create an issue or submit an MR!

Indices and tables#

Site#

This documentation site was built with Sphinx using the Sphinx Book Theme and hosted via GitLab Pages.