Skip to main content

flagparse is library to build command-line interfaces

Project description


Build Status

Flagparse is a library for building modular command-line interfaces with accent on nested commands. This library removes the pain of manually constructing the argument parsing and applying handler for each command, all of this is done by this tiny library.


pip install flagparse

Usage and documentation

Please see the wiki for basic usage and other documentation of using flagparse.

Here is an example of a simple Flagparse app:

import flagparse

class Sum(flagparse.SubCommand):
    """Sub-command to handle numbers summation."""

    name = "sum"
    arguments = [
              help="integers to be summed")),

    def handle(self, args: flagparse.Namespace) -> None:

class Calc(flagparse.Command):
    """A simple calculator that sums numbers."""

    name = "calc"

if __name__ == "__main__":

How it looks when run:

$ python sum 1 2 3


The openflow library is distributed under MIT license, therefore you are free to do with code whatever you want. See the LICENSE file for full license text.

Project details

Download files

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

Source Distribution

flagparse-0.0.3.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

flagparse-0.0.3-py2.py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page