typed-argument-parser
typed-argument-parser copied to clipboard
Typed argument parser for Python
Hi I would like to propose this PR to fulfill #75 request Sadly attributes cannot be decorated, so I introduce a new syntax that allow an attribute to be ignore....
Hi I would like to propose this PR to fulfill #70 request With it this code ```python # code.py from enum import Enum from tap import Tap class MyEnum(str, Enum):...
This PR fulfill #84 request to support single-quoted doc With it ```python # code.py from pathlib import Path from tap import Tap class Args(Tap): db: Path "database file" Args().parse_args() ```...
I would like to make typed-argument-parser a requirement in an environment that I would like to be installed by conda. Could tap also be made to be installable with conda?
TAP behaves differently from the original ArgumentParser's `__dict__`. In ArgumentParser, we can do `args.__dict__` to get a dict in which only the arguments we added are enumerated. In TAP, however,...
Here's a little demo: ``` from tap import Tap class Stuff(Tap): test: bool = True def __init__(self): super().__init__(self, explicit_bool=True) if __name__ == "__main__": args = Stuff().parse_args() print(args.test) ``` Then if...
This issue is similar to #71, though I believe different enough for a separate issue. The use-case is as follows: a previous configuration is loaded from json file, with arguments...
Hi! tap is a great argument parser, thank you for making it available! I'm writing a small program that would be useful both as a function and a CLI tool....
I sometimes use the following pattern to enable some functonality by default but still allow disabling it: ```python parser = ArgumentParser() parser.add_argument('--skip-thingy', action='store_false', dest='do_thingy') args = parser.parse_args(...) if args.do_thingy: #...
```py class Args(Tap): db: Path "database file" ``` does not seem to take the string "database file" as the doc string for `db`. With `"""database file"""` it works. According to...