Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'url:pypi': 0.03; 'interfaces': 0.04; '(of': 0.07; 'everyone!': 0.07; 'kaiser': 0.07; 'explanation': 0.09; 'latter': 0.09; 'parameter': 0.09; 'release.': 0.09; 'url:github': 0.09; 'cc:addr:python-list': 0.11; 'project,': 0.12; 'arg': 0.16; 'bullet': 0.16; 'command-line': 0.16; 'deduced': 0.16; 'examples:': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'landing': 0.16; 'repetition': 0.16; 'subject: \n ': 0.16; 'subject:parser': 0.16; 'url:py': 0.16; 'wrote:': 0.18; 'module': 0.19; 'passing': 0.19; 'cc:addr:python.org': 0.22; 'install': 0.23; 'decorators': 0.24; 'merge': 0.24; 'simpler': 0.24; 'mon,': 0.24; 'together.': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'source': 0.25; 'changes,': 0.26; 'handling': 0.26; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'function': 0.29; 'message-id:@mail.gmail.com': 0.30; 'parameters.': 0.31; 'subject:that': 0.31; "who'd": 0.31; 'file': 0.32; 'interface': 0.32; 'url:python': 0.33; 'are:': 0.33; 'minimal': 0.33; 'actual': 0.34; 'maybe': 0.34; 'subject:from': 0.34; 'basic': 0.35; 'created': 0.35; 'possible.': 0.35; 'plans': 0.35; 'received:google.com': 0.35; 'functions.': 0.36; 'maintained': 0.36; 'url:org': 0.36; 'should': 0.36; 'mine': 0.38; 'pm,': 0.38; 'does': 0.39; 'extended': 0.61; 'new': 0.61; 'our': 0.64; 'more': 0.64; 'here': 0.66; 'clicking': 0.73; 'links,': 0.74; 'obvious': 0.74; 'subject:your': 0.76; 'goals': 0.81; '2015': 0.84; 'explanation:': 0.84; 'grew': 0.84; 'url:master': 0.84; 'to:none': 0.92; 'feet': 0.93; 'browse': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=bpqfa0db7trV81hZtm05Meqdht/L/nI3hHFhDsr/xQQ=; b=cz1tSNPpLt4SNX2BRCZPguZHUhYP5KmpP9con944wlyIR1uMJ6EnKpWeBnTFgcaUsj 1Q2ohoK62K5Mrf7J+DVLYk/Lg0rnykESihxD48FL9UJpbD/n3oIbr5a5rwcn2TMX1HJd SXXzLGLt1Qk3hxiI7ipIIr8vUr6GwuRPdevoLKkik0xmpGvki4ULBMG10CmJbwaT0Ae8 PzNqiTZHH1pVjtzFfaCqRl/+YO2U1+iA9f5sMGt2DTNzZicm919O70iOUUc91tI1xVU9 bIGDxMCzFhU9BLAKb3iaL/1JD3Sn20KvPJcF7Vc5XulqR7CXfdQ7tkIeZEDCq9w2xyCm Uacg== MIME-Version: 1.0 X-Received: by 10.50.43.196 with SMTP id y4mr16696168igl.14.1430179416894; Mon, 27 Apr 2015 17:03:36 -0700 (PDT) In-Reply-To: References: Date: Tue, 28 Apr 2015 10:03:36 +1000 Subject: Re: Clize 3.0b1: An argument parser that draws a CLI from your function sigature From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 45 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1430179419 news.xs4all.nl 2915 [2001:888:2000:d::a6]:47042 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:89472 On Mon, Apr 27, 2015 at 7:02 PM, Yann Kaiser wrote: > Hello everyone! > > After a few years in development, I am proud to say Clize is landing its > feet again and is now in beta for an upcoming release. > > You can try it out using pip install --user clize=3.0b1 and you can > browse the docs at https://clize.readthedocs.org/ > > For those who'd like an explanation before clicking links, here's Clize's > 5-bullet point explanation: > > * Command-line interfaces are created by passing functions to `clize.run`. > * Parameter types are deduced from the functions' parameters. > * A ``--help`` message is generated from your docstrings. (Why does this > still need to be a bullet point?) > * Decorators can be used to reuse functionality across functions. > * Clize can be extended with new parameter behavior. Interesting. I've also been working on a simpler arg handling module; maybe we can work together. The goals for mine are: * Each function should be as independent as possible. * Minimize repetition (of names, descriptions, etc) * Keep everything in the function signature * Simplify the basic and obvious usages https://github.com/Rosuav/docstringargs https://pypi.python.org/pypi/docstringargs/ There's a demo file in the source repo, plus here are a couple of actual usage examples: https://github.com/Rosuav/LetMeKnow/blob/master/letmeknow.py https://github.com/MikeiLL/appension/blob/master/fore/database.py The latter is an existing module in an existing project, and it grew a command-line interface with minimal changes, eg: https://github.com/MikeiLL/appension/commit/566f195 Can we merge our plans and make a single module that's more likely to be maintained long-term? No point over-duplicating! ChrisA