Skip to main content

A tool that makes creating command line flags super easy.

Project description PyPI package Documentation Status

A tool that makes creating command line flags super easy.

Similar to argparse, switching is no problem at all! You can even use the FlagParserExtended as if it were a normal ArgumentParser for full integration with existing arguments.

Install with:

pip install ezflags

Here’s a simple example:

import ezflags

parser = ezflags.FlagParser()
parser.add_flag('--flag', '-f', value=True, help="A demo flag.")

flags = parser.parse_flags()

To integrate with ArgumentParser:

from ezflags.ext import FlagParserExtended

parser = FlagParserExtended()
parser.add_flag('--flag', '-f', value=True, help="A demo flag.")
parser.add_argument('--arg', '-a', help="A demo argument.")

args = parser.parse_args() # Flags are included, too!

This can be invoked as such:

python --flag
# With ArgumentParser()
python --flag --arg arg

View the full documentation here.


Supports Python 3.6 and up.


MIT license. See the LICENSE file for more details.

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

ezflags-1.4.2.tar.gz (6.6 kB view hashes)

Uploaded source

Built Distribution

ezflags-1.4.2-py3-none-any.whl (10.6 kB view hashes)

Uploaded py3

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