Coder Social home page Coder Social logo

jnoortheen / arger Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 0.0 972 KB

Create argparser automatically from py3.6+ annotations :snake:.

Home Page: https://jnoortheen.github.io/arger/

License: MIT License

Python 100.00%
argparser typehints cli argparse docstrings

arger's Introduction

Hi there ๐Ÿ‘‹, I am Noortheen

  • ๐Ÿ’ผ I am a freelancer, developing web and desktop apps.
  • โšก I contribute back to the open source community as much as possible, especially the things I use regularly.
  • ๐Ÿ“ซ Contact:

arger's People

Contributors

dependabot[bot] avatar jnoortheen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

arger's Issues

Handling docstrings when using Argument class

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'}>)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.