jnoortheen / arger Goto Github PK
View Code? Open in Web Editor NEWCreate argparser automatically from py3.6+ annotations :snake:.
Home Page: https://jnoortheen.github.io/arger/
License: MIT License
Create argparser automatically from py3.6+ annotations :snake:.
Home Page: https://jnoortheen.github.io/arger/
License: MIT License
Try to run the example in
https://github.com/jnoortheen/arger/blob/1bb8b4ec7d6f4787d3fcb40f4423a0d2013ab518/docs/examples/3-arger-as-function/src.py
python src.py -o 'log.txt' list
This shows error:
pytest: error: argument -o/--log-file: invalid typing.Union value: 'log.txt'
Hi, thanks for this very nice library. It looks very good.
I have a suggestion. Would it be possible to support Literals: https://docs.python.org/3/library/typing.html#typing.Literal
Right now, we can use Enum to denote choices, which is good. But we can also use the new Literal typing to denote choices, which can be very convenient.
Say, I want to create a countable argument like this
Verbosity = Argument(type=int, action='count', default=0)
@Arger.init(prog='parse')
def arger(verbosity: int = Verbosity, config_path: Path = DEFAULT_CONFIG_PATH):
"""My Parser.
Args:
verbosity: Counted argument, use -v for info and -vv for debug.
config_path: Path to config file.
"""
The help string for verboisty shows this
-v VERBOSITY, --verbosity VERBOSITY
Counted argument, use -v for info and -vv for debug. (default: <Argument: (), {'default': 0, 'type': <class 'int'>, 'action':
'count'}>)
Can we modify the default value part of the help string to show as 0 instead of
(default: <Argument: (), {'default': 0, 'type': <class 'int'>, 'action': 'count'}>)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.