Skip to content

Releases: swansonk14/typed-argument-parser

Literals, explicit bools, dashes

27 Dec 23:58
Compare
Choose a tag to compare

Three main changes:

  1. Added support for Literal types, which automatically specify the choices for an argument based on the specified Literal values (ex. arg: Literal['abc', 123] is equivalent to parser.add_argument('--arg', choices=['abc', 123])
  2. Created an option called explicit_bool that requires boolean arguments to be specified as --arg True or --arg False (or any prefix of True or False, case insensitive) rather than --arg.
  3. Created an option called underscores_to_dashes which replaces the underscores in variables names with dashes when specified on the command line (ex. arg_1 in the Tap object becomes --arg-1 on the command line)

Fixes

08 Sep 02:19
Compare
Choose a tag to compare

Two bug fixes:

  • Git url extraction now works for GitHub Enterprise urls
  • Since inspect.getsource sometimes throws exceptions (e.g. when inside a Python shell), added a try/except to allow Tap to work even in these scenarios

Improved help strings

23 Aug 05:26
Compare
Choose a tag to compare

The primary change is that help strings are now parsed from single line comments on the same line as class variable definitions.

Additionally, Tap now supports Optional and Set by default.

v_1.1

28 Dec 02:12
Compare
Choose a tag to compare
Removing comment