Skip to main content

Parse parameter lists in argparse arguments, e.g. --arg sub1 sub2=val ...

Project description

argparse_subargs

Parse parameter lists in argparse arguments, e.g. --arg sub1 sub2=val ...

This module defines:

class SubargParser

Parser for structured sub-arguments of argparse arguments. The subarguments can be positional arguments or keyword-arguments, e.g.: myprog.py --print Welcome Message name=Michael role=brother

class SubargAction

Action class to be used with a SubargParser instance. To do so, use arguments action=SubargAction and subarg_parser= when calling add_parameter() method of ArgumentParser.

class SubargHelpFormatter

Formatter for help when using action=SubargAction in add_parameter() of ArgumentParser. Uses SubargHelpFormatterMixin and HelpFormatter to do the actual work.

class SubargHelpFormatterMixin

Mixin for creating formatter classes for use with ArgumentParser when SubargHelpFormatter is not suitable. This could, e.g., be

class MyDefaultsFormatter(
         SubargHelpFormatterMixin, 
         argparse.ArgumentDefaultsHelpFormatter)
    pass

class PSubarg

Positional subarg description with __eq__ operator.

class KWSubarg

Keyword subarg description with __eq__ operator.

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

argparse_subargs-0.9.2.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

argparse_subargs-0.9.2-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file argparse_subargs-0.9.2.tar.gz.

File metadata

  • Download URL: argparse_subargs-0.9.2.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for argparse_subargs-0.9.2.tar.gz
Algorithm Hash digest
SHA256 37701340cef941a8a7b025d210dbed0effc64cbf4cf45386a929f07edf10b8bf
MD5 02347feeec3e9619a7bbd3e1f9066783
BLAKE2b-256 b85a40538d00f1928a9feffb9083a49b5c47db435a6d769e3cd0ac30e56fde09

See more details on using hashes here.

File details

Details for the file argparse_subargs-0.9.2-py3-none-any.whl.

File metadata

File hashes

Hashes for argparse_subargs-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a2b78e5303d7a05fbf5c6ba6bf8aab2481bd364899e5682e837300d3131204fd
MD5 f93d97d8c3103b4e50979ef07abf4d0d
BLAKE2b-256 39f824445ddcd5e13d18e7aaf91909732e91279228c531b3b4a804c874de5cde

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