Skip to main content

command line parsing library

Project description

optmatch - Library to allow an easy and effective parsing of command line options.

Full documentation: http://coderazzi.net/python/optmatch

optmatch is based on expressing the actions -with all options and related flags- that are supported, instead of just listing all possible argument flags.

For example:

class Example(OptionMatcher):

@optset

def handle_common_flag(self, mail_option):

@optmatcher

def handle_compression(self, filename, compress_flag =False):

@optmatcher(flags=’verbose’, options=’mode’)

def handle(self, filename, verbose=False, mode=’simple’, where=None):

In this example:

  1. It is defined a common flag (–mail)

  2. It is defined an action, supporting a –compress flag which is False by default, and requiring a filename parameter

  3. It is defined a second action, supporting a –verbose flag and a –mode option, requiring one or two file locations.

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

optmatch-0.9.1.tar.gz (15.6 kB view details)

Uploaded Source

File details

Details for the file optmatch-0.9.1.tar.gz.

File metadata

  • Download URL: optmatch-0.9.1.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for optmatch-0.9.1.tar.gz
Algorithm Hash digest
SHA256 e0b1d51f3d6bc5da719564f69f2a05e0a58c48f2cc1e4c3b4aab542cd436bc8b
MD5 4d11d534c63890b27ab25f7d599ab20e
BLAKE2b-256 4b5e8c7dba0985c99879e1591a7cc65a527e1b41109932217eef26d33de02227

See more details on using hashes here.

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